04 2015 档案

摘要:之前做过的最长上升子序列的题只是不需要输出这个序列http://www.cnblogs.com/Scale-the-heights/p/4333346.html做法就是从左到右扫一遍,可以参见http://blog.csdn.net/shuangde800/article/details/74749... 阅读全文
posted @ 2015-04-15 18:54 Scale_the_heights 阅读(1070) 评论(0) 推荐(0)
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=1631题目大意:用把一堆数字分为两A、B两堆,一堆m个一堆n个。问A堆数字之和与B堆数字... 阅读全文
posted @ 2015-04-13 22:22 Scale_the_heights 阅读(155) 评论(0) 推荐(0)
摘要:dp[i][j]=1表示用前i个数字可以凑成余数为j。若dp[i-1][j]=1 ,则dp[i][(j+num[i])%k]=1;dp[i][((j-num[i]+k)%k+k)%k]=1#include #include #include #include using namespace std;... 阅读全文
posted @ 2015-04-08 16:12 Scale_the_heights 阅读(221) 评论(0) 推荐(0)
摘要:[困]坑点:无向边,每条边只能走一次,但正向走一次后反向还能走一次,所以每次输入要建四条边。#include #include #include #include #include using namespace std;int n,m,cnt;int head[50500],vis[50500],... 阅读全文
posted @ 2015-04-02 22:32 Scale_the_heights 阅读(355) 评论(0) 推荐(0)