摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1003感觉自己的dp弱爆了。。以前做的都忘得差不多了,只能从最基础的再学一遍吧。。求最大连续子段和。要知道一个定理,即最大连续子段和中不可能包含负的子段和。对于序列(....i......j,j+1.....),如果sum(i,j) 2 #include 3 const int N=100010; 4 int a[N]; 5 int main() 6 { 7 int t,n,o = 0; 8 scanf("%d",&t); 9 while(t--)10 {11 ... 阅读全文
posted @ 2014-02-28 17:24 N_ll 阅读(148) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1811 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int N=200010; 7 vectorV[N]; 8 queueq; 9 char oper[N];10 int in[N],f[N];11 int a[N],b[N];12 int n,m,sum;13 void init()14 {15 sum = n;16 while(!q.empty()) q.pop();17 ... 阅读全文
posted @ 2014-02-28 14:04 N_ll 阅读(195) 评论(0) 推荐(0)