上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 99 下一页

2011年8月9日

非常可乐 hdu 1495

摘要: 此题需要注意的是。最后的判断条件应是。。S == M + N ..刚开始把判断条件搞错了。认为只要任意两杯相加与第三杯相等即可。。悲剧啊。改了我一个多时侯。改来改去还是测试数据还是2.。。最后把测试数据手算下才知道。。判断条件写错了。。代码写得有点差。。#include <stdio.h>#include <string.h>#include <stdlib.h>#include <queue>using namespace std;int S, N, M, t;struct node{ int s, n, m, t; bool operator 阅读全文

posted @ 2011-08-09 16:38 more think, more gains 阅读(279) 评论(0) 推荐(0) 编辑

Rescue hdu 1242 BFS

摘要: 此题要注意的是多个。。r..还加优先队列。。才能保证每次到r才是最小时间的。RescueTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5900Accepted Submission(s): 2193Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, 阅读全文

posted @ 2011-08-09 13:01 more think, more gains 阅读(220) 评论(0) 推荐(0) 编辑

诡异的楼梯 BFS hdu 1180

摘要: 这题好邪恶啊。做了两个半小时wa得好辛苦。原因是。。可以停留在空格里的。题意不清啊。还有就是注意标记。。开了个三维的数组。。分奇数步和偶数步标记。。最后有可能时间多的先出队。所以要选个最小的时间。。其实可以用优先队列做。。艾。。这代码有点太长了。。#include <stdio.h>#include <string.h>#include <stdlib.h>#include <deque>#include <algorithm>#include <iostream>using namespace std;int a, b, 阅读全文

posted @ 2011-08-09 11:08 more think, more gains 阅读(154) 评论(0) 推荐(0) 编辑

2011年8月8日

A计划 hdu 2102

摘要: 此题刚开始TLE,愿意是没有考虑通过传输层到下一层时还是#,或*....然后又开始了悲剧的wa...原因是我从某点走到'#'时。。时间没有加1.。。BFS。。。#include <stdio.h>#include <string.h>#include <stdlib.h>#include <queue>#include <algorithm>#include <iostream>using namespace std;char mp1[12][12];char mp2[12][12];int T, M, N 阅读全文

posted @ 2011-08-08 21:57 more think, more gains 阅读(187) 评论(0) 推荐(0) 编辑

poj 3549 基本网络流

摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>#include <deque>#include <algorithm>using namespace std;int cap[1000][1000];int flow[1000][1000];int a[1000];int f;int p[1000];const int inf = 0x7fffffff;void Edmonds_karp(int N, int M ){ deque<int>q; int t, 阅读全文

posted @ 2011-08-08 09:58 more think, more gains 阅读(217) 评论(0) 推荐(0) 编辑

上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 99 下一页

导航