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 1071. Nikifor 2

Who can give me some tests?I got WA all the time!(+)
Posted by Acid Pea 25 May 2003 11:32
program p1071;
var x,y,z,s,i:longint;
    out:boolean;
procedure check(p:longint);
var  x1,y1:longint;
     c:array[0..10000] of integer;
begin
     fillchar(c,sizeof(c),0);
     x1:=x;y1:=y;
     repeat
           inc(c[x1 mod p]);
           x1:=x1 div p;
     until x1=0;
     repeat
           if c[y1 mod p]>0 then dec(c[y1 mod p])
                            else exit;
           y1:=y1 div p;
     until y1=0;
     out:=true;
end;
begin
     readln(x,y);z:=0;out:=false;
     for i:=2 to x do
         if x mod i=y mod i then
         begin
              check(i);
              if out then break;
         end;
     if out then write(i)
            else write('No solution');
     readln;
end.
Didn't you get AC??(-)
Posted by Ural_Happy New Year! 25 May 2003 13:59
If I got AC,why I put my program on these webboard?ОТУРІЎ°Ў?!
Posted by Acid Pea 25 May 2003 19:32
>
Ural_Yintong is quite silly
Posted by ACer 25 May 2003 21:03
> >
Don't "Chuan" anyone!
Posted by Acid Pea 26 May 2003 04:51
"diao 3",that
Posted by Ural_Happy New Year! 26 May 2003 18:04
>
Re: Who can give me some tests?I got WA all the time!(+)
Posted by Daniial 19 Feb 2021 15:53
> > >