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 1051. Simple Game on a Grid

whi i get WA end please tell me how i mast do it and i will tell you senc your?here is a my program
Posted by I am david. Tabo. 22 Apr 2002 17:47
var m,n,sol:longint;
begin
  readln (m,n);
  if m=1 then
    sol:=(n+1) div 2
  else
    if (m mod 3=0)or(n mod 3=0) then
      sol:=2
    else
      sol:=1;
  writeln (sol);
end.
You must replace m and n if m>n. OK?
Posted by meoden 23 Apr 2002 19:00
> var m,n,sol:longint;
  var tg:longint;
> begin
>   readln (m,n);
   if m>n then
   begin
      tg:=m;
      m:=n;
      n:=tg;
   end;
>   if m=1 then
>     sol:=(n+1) div 2
>   else
>     if (m mod 3=0)or(n mod 3=0) then
>       sol:=2
>     else
>       sol:=1;
>   writeln (sol);
> end.
>
>
senk ypur a got ACCCCCCCC!!!!!!!
Posted by I am david. Tabo. 23 Apr 2002 19:37
> > var m,n,sol:longint;
>   var tg:longint;
> > begin
> >   readln (m,n);
>    if m>n then
>    begin
>       tg:=m;
>       m:=n;
>       n:=tg;
>    end;
> >   if m=1 then
> >     sol:=(n+1) div 2
> >   else
> >     if (m mod 3=0)or(n mod 3=0) then
> >       sol:=2
> >     else
> >       sol:=1;
> >   writeln (sol);
> > end.
> >
> >
Re: senk ypur a got ACCCCCCCC!!!!!!!
Posted by Acid Pea 13 Dec 2002 19:08
 var m,n,sol:longint;
 var tg:longint;
begin
   readln (m,n);
  if m>n then
    begin
       tg:=m;
       m:=n;
     n:=tg;
  end;
   if m=1 then
     sol:=(n+1) div 2
   else
     if (m mod 3=0)or(n mod 3=0) then
      sol:=2
   else
      sol:=1;
 writeln (sol);
 end.

Re: senk ypur a got ACCCCCCCC!!!!!!!
Posted by SM 22 Dec 2006 10:32
but why?can anyone tell me?