|
|
back to boardA few questions(+) 1.The prob says we can only place '+','#','A'..'Z' on the tape. So can't we place '-'? But the sample output places '-'! 2.What's the range for condition? So I don't understand why my prog gets WA: program ural1231; const maxn=200; var remain:array[1..maxn]of byte; k,i:byte; begin read(k); remain[1]:=1; for i:=2 to maxn do begin remain[i]:=(remain[i-1]+k) mod i; if remain[i]=0 then remain[i]:=i; end; writeln('1 # 1 # >'); for i:=1 to maxn do writeln(i,' - ',i+1,' + >'); for i:=1 to maxn do writeln(i+1,' # ',1000+i-remain[i],' # <'); for i:=1 to maxn do writeln(1000+i,' + ',999+i,' + <'); writeln('1000 + 1000 - ='); end. Re: A few questions(+) 1. I don't know why can't you place "-", but you needn't do it. 2. I believe -/+ MAXINT32. Mine solution used condition like 100001 3. Your prog doesn't output the number of lines of the control table. |
|
|