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

为什么总是CE和TLE

Posted by 1004101213 at 2011-07-23 15:55:13 on Problem 2083
#include<stdio.h>
#include<math.h>
int i,n,k,x,y,t;
int main()
{
      while(scanf("%d",&n)&&n!=-1)
      {
          k=pow(3,n-1);
		for(i=0;i<k*k;i++)
		{
			for(x=i/k,y=i%k,t=n;--t&&(x%3+y%3)%2==0;x/=3,y/=3);
			{
			    if(t==0)printf("X");  else printf(" ");
                if(i%k>=k-1)puts("");
			//printf("%c%s",t?32:88,i%k<k-1?"":"\n");
			}
		}
		puts("-");
      }
return 0;
}

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