摘要: 以前做过类似的。卡了精度一次,2Y。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: humble 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace std;12 #define N 100000000013 long long prim[100011];14 int num[101],o[101];15 阅读全文
posted @ 2012-11-15 18:37 Naix_x 阅读(168) 评论(2) 推荐(0) 编辑
摘要: 好搞没搞背包问题了。这个问题太模版了。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: inflate 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace std;12 #define N 10000000013 int c[10001],v[10001],p[10001];14 int main()15 阅读全文
posted @ 2012-11-15 18:12 Naix_x 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 虽然好久没敲过了prim,迅速秒掉。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: agrinet 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace std;12 #define N 10000000013 int p[101][101],low[101],o[101];14 int main()15 阅读全文
posted @ 2012-11-15 17:05 Naix_x 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 郁闷,没看见76个字符换行啊。。。。一直错。。。。然后看着数据,添各种坑,终于让这搓代码过了。。。磕磕绊绊终于结束第二章了!!!上图。总体上来说,是乱搞题目,模拟之类居多,比我想像的刷的快啊。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: fracdec 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace 阅读全文
posted @ 2012-11-15 16:53 Naix_x 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 水题,没注意无向边,2Y。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: comehome 5 */ 6 #include <iostream> 7 #include <cstdio> 8 #include <cstring> 9 #include <cmath>10 #include <algorithm>11 using namespace std;12 #define N 10000000013 int p[101][101];14 int judge(char ch)15 {16 if(ch &g 阅读全文
posted @ 2012-11-15 15:37 Naix_x 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 这个题意真心看不懂,看了一下翻译,看了好一会汉语的,终于理解了。给一个图,可能有几个联通的集合,问加上一条边,使得两个集合联通变为一个集合,使得这个集合的点的之间的最短路中的最大的那一条最短。开始YY一下是否贪心,好像不是,感觉用到了求次小生成树的思想之类的。YY了一个算法,搞了一数组d[i],来记录i所在集合,距离i最远的距离,然后枚举加的边是(i,j)。复杂度应该没什么问题,然后提交,挂了,有点怀疑算法的正确性了,不过还好,想到还要和原来的最短路里边的最长路进行判断,又写了个DFS,AC了。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: c... 阅读全文
posted @ 2012-11-15 12:33 Naix_x 阅读(1523) 评论(0) 推荐(0) 编辑