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

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.
> 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.
>
>
I am david. Tabo. senk ypur a got ACCCCCCCC!!!!!!! [2] // Problem 1051. Simple Game on a Grid 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.
> >
> >
Acid Pea Re: senk ypur a got ACCCCCCCC!!!!!!! [1] // Problem 1051. Simple Game on a Grid 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.

but why?can anyone tell me?