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 |
比较不臃肿 (~ v ~)In Reply To:哎,还不如把代码完整贴出来呢! Posted by:NeverWin at 2008-10-05 18:20:21 int i,j,k,t,l,s[2555],a[2555],T; main(){ for(scanf("%d",&T);T--;puts("")){ memset(a,0,8888); for(scanf("%d",&k),i=k;i--;)scanf("%d",s+i); for(scanf("%d",&i);i--;){ scanf("%d",&t); for(j=0;j<k;j++)a[j+i]=(a[j+i]+t*s[j])%2; } for(scanf("%d",&l),i=0;i<l;i++)scanf("%d",s+i); for(l--,k=2010;l<=k;k--)if(a[k]) for(i=0;i<=l;i++)a[k-i]^=s[i]; for(;!a[k];k--); for(printf("%d",k+1);0<=k;k--)printf(" %d",a[k]); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator