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 1110. Power

Solution!!!
Posted by And IV (ucs-usty-forever) 6 Mar 2007 20:08
program _1110;

{$APPTYPE CONSOLE}

uses
  SysUtils;

Var N,i,o,m,y,x:cardinal;
Exist:boolean;
begin
  Exist:=false;
  Readln(n,m,y);
  For I:=0 to m-1 do
   begin
   x:=i;
   For o:=2 to n do   X:=x*i mod m;
   if x=y then
    begin
     exist:=true;
    Write(i,' ');
    end;
   End;
   if not exist then write('-1');
end.
Re: Solution!!!
Posted by shipulin13 24 Apr 2008 15:54
you good man