Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
其实可以往回推,DP,可以发现2个合体有4中,后面就是技术是2种,偶数有3种for(int i=3;i<=1000;i++){ ai[i]=ai[i-1]+ai[i-2]*4;int t=2; for(int j=i-3;j>=1;j--){ ai[i]=ai[i]+ai[j]*t; if(t==2){ t=3; }else{ t=2; } } ai[i]=ai[i]+t; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator