上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页
摘要: 题意:求1到2所有路径中最小蛙跳 蛙跳:在一条路径中所有蛙跳中的最大蛙跳思路:dijska算法思想#include#includeusing namespace std;struct Node{ double x,y;}node[222];double dist[222];int s[222];in... 阅读全文
posted @ 2014-06-06 14:55 _一千零一夜 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题意:难得的中文题思路:dijkstra算法的运用 新源点合并到旧源点时,新源点到旧源点的边权的移交(也可理解为松弛)实在是不想做这个题 抄了个代码 这个代码太完美了 1 #include 2 using namespace std; 3 4 const int inf=0x7ff... 阅读全文
posted @ 2014-06-05 17:18 _一千零一夜 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题意:一个图中有两种路径 1 无方向权值为政 2 有方向权值为负 问是否存在一个回路其权值为负思路:bellman算法#includeusing namespace std;struct Edge{ int u,v; int w;}e[15000];int all;int dist[15... 阅读全文
posted @ 2014-06-04 20:19 _一千零一夜 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题意:给定N中货币 两种货币之间可以兑换 并且收取一定的费用 问 给定你一种货币与数量 是否能兑换到原来的货币 使自己的货币增加思路:用bellman算法 判断是否有回路不断的增大;#include#includeusing namespace std;struct Node{ int u,v; d... 阅读全文
posted @ 2014-06-04 19:22 _一千零一夜 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题意 :看的太快 没注意题意 改了几次#include#includeusing namespace std;struct Node{ int x,y; int sum;}w[10][10],b[10][10];bool cmp(Node x,Node y){ if(x.x=1;i... 阅读全文
posted @ 2014-05-31 10:17 _一千零一夜 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 今天心情不好 找个代码 看着不错 直接提交#include#includeusing namespace std;const int Max = 100; char map[17][34] = { "+---+---+---+---+---+---+---+---+", ... 阅读全文
posted @ 2014-05-31 10:16 _一千零一夜 阅读(191) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;struct Node{ char data; Node *l,*r;};int get(int x){ return (x+1)/2;}void build(Node *t,int l,int r){ // char c; cout>t->d... 阅读全文
posted @ 2014-05-28 19:03 _一千零一夜 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题意:给定每一步的定方向与初始位置 让求出去房间 或者进入循环的步数直接模拟#include#includeusing namespace std;int map[11][11];int v[11][11];int dir[4][2]={-1,0,1,0,0,-1,0,1};int main(){ ... 阅读全文
posted @ 2014-05-28 12:41 _一千零一夜 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题意:一个房间由m*n个方块组成 每个机器人占据一个方块 这些机器人能够移动 问 这些机器人的移动动作全部完成后 会不会发生冲撞事件解题策略:简单的模拟题目#include#includeusing namespace std;struct Node{ int x,y; int dir... 阅读全文
posted @ 2014-05-27 19:54 _一千零一夜 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题意:给定p数组 让求w数组 p数组;S (((()()()))) P-sequence 4 5 6666//)括号 左边(括号的个数 W-sequence 1 1 1456//)括号所匹配的括号中的括号对数用一个栈来模拟#includeusing namespac... 阅读全文
posted @ 2014-05-26 20:24 _一千零一夜 阅读(131) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页