Reply to message- Messages should be written in English and correspond to the matter of the website.
- Messages should not contain offences and obscene words.
- Messages should not contain correct solutions.
Re: what is the difference between this code and that code, still get wrong Posted by VNeo 16 Jul 2017 06:35 oh , i forgot. The neighbored code is this var ans: array[1..1000] of longint; n,m,y,q,i: longint; function BinPow(x,y: longint): longint; begin if y=1 then BinPow:=x else if y mod 2=0 then BinPow:=sqr(BinPow(x,y div 2)) mod M else BinPow:=(sqr(BinPow(x,y div 2))*x) mod M; end; begin readln(n,m,y); q:=0; for i:=0 to m-1 do begin if BinPow(i,n)=y then begin inc(q); ans[q]:=i; end; end; for i:=1 to q do write(ans[i],' '); if q=0 then writeln(-1); end. netman from timus judge, sorry for copied your code.
|