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 |
没看懂题,好在AC了(附代码)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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator