ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1231. Turing: One, Two, Three, …

A few questions(+)
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 31 Oct 2004 03:55
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(+)
Posted by Veselin Georgiev 7 May 2005 06:43
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.