Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

比较不臃肿 (~ v ~)

Posted by tzkq at 2010-07-13 23:38:52 on Problem 1060
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator