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 |
USACO代码直接代入……^_^ 0MS(附代码)const change:array[1..9,1..9]of integer= ((3,3,3,3,3,2,3,2,0), (2,3,2,3,2,3,1,0,1), (3,3,3,2,3,3,0,2,3), (2,3,1,3,2,0,2,3,1), (2,3,2,3,1,3,2,3,2), (1,3,2,0,2,3,1,3,2), (3,2,0,3,3,2,3,3,3), (1,0,1,3,2,3,2,3,2), (0,2,3,2,3,3,3,3,3)); var temp,ans:array[1..9] of integer; i,j,k:integer; s:string; begin for i:=1 to 9 do begin read(temp[i]); end; close(input); fillchar(ans,sizeof(ans),0); for i:=1 to 9 do for k:=1 to 9 do inc(ans[k],change[i,k]*(4-temp[i])); for i:=1 to 9 do ans[i]:=ans[i]mod 4; s:=''; for i:=1 to 9 do for j:=1 to ans[i] do s:=s+chr(i+48)+' '; delete(s,length(s),1); writeln(s); end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator