|
|
back to boardWhat is 10 test? Posted by Роман 1 Feb 2007 16:27 Write me 10 test, please ! Re: What is 10 test? I got WA#10,too! Re: What is 10 test? write test 10 pls Re: What is 10 test? I dont know test 10.But I can help you if you give me your algo or code. I have already solved this problem. my email is ibragim.atadjanov@gmail.com Re: What is 10 test? Posted by teoy 8 Oct 2011 21:33 First I got WA on test 10.Because my DP solution is wrong: this is AC solution: tt[0].a=tt[0].b=0; for(int i=1;i<=k;i++) { scanf("%d%d",&tt[i].a,&tt[i].b); } sort(tt,tt+k+1,cmp); memset(dp,0,sizeof(dp)); for(int i=1;i<=k;i++) { for(int j=0;j<i;j++) { if(tt[j].a<tt[i].a&&tt[j].b<tt[i].b) { dp[i]=max(dp[j]+1,dp[i]); } } }
this is WA solution for(int i=1;i<=k;i++) { scanf("%d%d",&tt[i].a,&tt[i].b); } sort(tt+1,tt+k+1,cmp); memset(dp,0,sizeof(dp)); dp[1]=1; for(int i=2;i<=k;i++) { for(int j=1;j<i;j++) { if(tt[j].a<tt[i].a&&tt[j].b<tt[i].b) { dp[i]=max(dp[j]+1,dp[i]); } } } sorry for my poor English .hope to help~ Re: What is 10 test? Posted by tuan 19 Apr 2013 11:44 me too! |
|
|