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

没看懂题,好在AC了(附代码)

Posted by checkoj at 2012-07-10 20:48:43 on Problem 1086
int cas=1;
int paint[555],pos[555];

void solve()
{
	int n,m,a,b;
	RD2(n,m);REP(i,1,m){RD2(a,b);pos[b]=a;}
	RD1(m);clr(paint,-1);REP(i,1,m){RD2(a,b);paint[a]=b;}
	printf("Case %d\n\n",cas++);
	REP(i,0,n-1)REP(j,0,n-1)
	{
		int k=pos[i*n+j];while(paint[k]<0)k=(k-1)/4;
		printf("%4d",paint[k]);if(j==n-1)puts("");
	}
	puts("");
}
int main(){MCASE;}

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