摘要:
bfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 55struct Point{ int x, y;}q[maxn * maxn];int n, m, ans;int map[maxn][maxn];bool vis[maxn][maxn];int dir[4][2] ={{ 0, -1 },{ -1, 0 },{ 0, 1 },{ 1, 0 } };bool o 阅读全文
posted @ 2011-07-12 09:41
undefined2024
阅读(239)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>using namespace std;char st[100];int main(){ //freopen("t.txt", "r", stdin); while (scanf("%s", st)) { if (strcmp(st, "#") == 阅读全文
posted @ 2011-07-12 09:07
undefined2024
阅读(286)
评论(0)
推荐(0)
摘要:
dfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 25int n, m;int f[maxn], s[maxn];int ans;void dfs(int cow, int sum){ if (ans == 0) return; if (s[cow] + sum < m) return; if (sum >= m) { ans = min(ans, s 阅读全文
posted @ 2011-07-12 08:32
undefined2024
阅读(172)
评论(0)
推荐(0)