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

Show all messages Hide all messages

Re: What's the algorithm to this problem? Hieu Nguyen 8 Oct 2001 00:50
> This is a my solution:
Suppose: m<=n
if m=1 then sol:=(n+1) div 2 else
begin
  if (m mod 3=0)or(n mod 3=0) then sol:=2 else sol:=1;
end;
How did you realise this algorithm? Vinicius Fortuna 8 Oct 2001 04:17
How did you realise this algorithm?
How can you proof that?
This solution really impressed me! :-)
You may e-mail me: fortuna@acm.org

Thank you

> > This is a my solution:
> Suppose: m<=n
> if m=1 then sol:=(n+1) div 2 else
> begin
>   if (m mod 3=0)or(n mod 3=0) then sol:=2 else sol:=1;
> end;
>

>
> > > This is a my solution:
> > Suppose: m<=n
> > if m=1 then sol:=(n+1) div 2 else
> > begin
> >   if (m mod 3=0)or(n mod 3=0) then sol:=2 else sol:=1;
> > end;
> >