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 1224. Spiral

Show all messages Hide all messages

where is wrong? Sergey 21 Feb 2003 00:53
var n,m,otv:real;
begin
 read(n,m);
 otv:=0;
 if m<=n then
  begin
   n:=m;
   otv:=1;
  end;
 otv:=otv+2*(n-1);
 if (n=0) then writeln(0)
 else writeln(otv:0:0);
end.
Re: where is wrong? Marcin Mika 21 Feb 2003 05:56
>  if m<=n then
try m<n instead
Re: where is wrong? Sergey 21 Feb 2003 19:00
Thanks a lot. My prog got AC!
(+): I think my short Ac helps you. Locomotive 21 Feb 2003 10:30
Var
  m,n                 :comp;
begin
  readln(n,m);
  if n <= m then
    writeln((2*(n-1)):0:0)
  else
    writeln((2*(m-1)+1):0:0);
end.