摘要: 题目链接问了下学长,开始质量+价值反着背包,老是WA,油耗作为体积,核电做价值就AC了。。反着背的时候 没取最小值啊 。。。。又想当然的以为大于1/2的时候,输出就行了,得取最小啊!!!! 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <math.h> 5 #define N 10000000 6 int p[101][101],low[101],v[101],key[20000]; 7 int main() 8 { 9 int t,i,j, 阅读全文
posted @ 2012-08-11 19:28 Naix_x 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目链接好繁琐,想了好半天,开始以为暴搜。。比赛时一直卡这个题了,暴搜不出结果换了一个5维背包。。。瞎改一下过了,样例。。。交WA。。再改还是WA。。。自己对背包,理解的太肤浅啊。。。其实我也不知道为什么过,在多次,WA后,正着写就A了,倒着写就是WA。。。 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <math.h> 5 int p[6],o[6],kk[1001]; 6 int cl[3001][6],vl[3001]; 7 int q 阅读全文
posted @ 2012-08-11 15:36 Naix_x 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 题目链接裸Kruskal。注意两个圆想加的时候特判。无奈比赛时,没看懂题意。。求翻译啊。。 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <math.h> 5 struct node 6 { 7 int sv; 8 int ev; 9 double w;10 }p[100000];11 int o[101];12 double x[101],y[101],z[101],r[101];13 int num;14 double sum1;15 i 阅读全文
posted @ 2012-08-11 14:53 Naix_x 阅读(170) 评论(0) 推荐(0) 编辑