|
|
вернуться в форумPlease, give me some test!!! I take WR!!! I don't know what s wrong!!! ---------------------------------MY PROGRAM------------------------- var N,M,Y:longint; a:array[1..15]of byte; b:array[1..15]of longint; d:array[1..1000]of integer; h,x,l:integer; i,j,s:longint; begin assign(input,'1110.dat'); reset(input); readln(N,M,Y); x:=N; for i:=1 to 15 do begin a[i]:=x mod 2; x:=x div 2; if x = 0 then break; end; l:=i; for i:=0 to M-1 do begin b[1]:=i; for j:=2 to l do begin b[j]:=(b[j-1]*b[j-1]) mod M; end; s:=1; for j:=1 to l do if a[j]=1 then begin s:=(s*b[j]) mod M; end; if s = Y then begin inc(h); d[h]:=i; end; end; for i:=1 to h-1 do write(d[i],' '); if h<>0 then writeln(d[h]); end. And what about -1? (-) The answer for test 1 2 3 Should be -1 GL Thanks now I got AC > The answer for test > 1 2 3 > Should be > -1 > > GL Re: Please, give me some test!!! 0 0 0 _______ Answer: 0 Re: Please, give me some test!!! 0 0 0 _______ Answer: 0 No, because X in the interval [0, M − 1] I think answer is -1 Re: Please, give me some test!!! Since, (0 < N < 999, 1 < M < 999, 0 < Y < 999) the minimum input is: 1 2 1 with the answer 1 Re: Please, give me some test!!! Megakrit, This is best test! Thank you! Edited by author 27.10.2015 21:21 |
|
|