上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 182 下一页
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 105struct Point{ int x, y; Point() {} Point(int xx, int yy):x(xx), y(yy) {}};int n, m;bool grid[maxn][maxn];bool vis[maxn][maxn];int dir 阅读全文
posted @ 2013-03-26 19:34 undefined2024 阅读(188) 评论(0) 推荐(0)
摘要: 简单题View Code //zoj1708#include <iostream>using namespace std;const int maxn = 11;char order[maxn][maxn];int steps[maxn][maxn], n, m, start;void init(){ int i, j; memset(steps, 0, sizeof(steps)); for (i = 0; i < n; i++) for (j = 0; j < m; j++) ... 阅读全文
posted @ 2013-03-26 19:05 undefined2024 阅读(378) 评论(0) 推荐(0)
摘要: 简单题View Code //zoj1707#include <iostream>#include <string>using namespace std;const int maxn = 100;int n;string origin[maxn], replace1[maxn], sequence;void init(){ int i; for (i = 0; i < n; i++) { getline(cin, origin[i]); getline(cin, replace1[i]); ... 阅读全文
posted @ 2013-03-26 19:02 undefined2024 阅读(169) 评论(0) 推荐(0)
摘要: 并查集的经典题目,有人说也可以用floyd。并操作时要记录子节点与父节点的兑换比例。View Code //zoj1705//并查集,但是需要加入每个元素与祖先的价格比。 #include <iostream>#include <string>using namespace std;const int maxn = 200;string namelist[maxn];int listnum = 0, father[maxn][3];int toint(string st){ int i, l = st.length(), x = 0;... 阅读全文
posted @ 2013-03-26 15:58 undefined2024 阅读(154) 评论(0) 推荐(0)
摘要: 字符串处理麻烦题View Code //zoj1702#include <iostream>#include <string>using namespace std;const int maxlength = 2001, maxl = 100, maxc = 30;string header, nextheader, word[maxl][maxc];int lnum, cnum, csize[maxc];void init(){ string st; int l = 0, c = 0, i; memset(csiz... 阅读全文
posted @ 2013-03-26 15:48 undefined2024 阅读(247) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 182 下一页