|
|
back to boardCommon Boardwhy WA#4 /problem 1110/ #include <iostream.h> #include <conio.h> #include <math.h> void main() { int x, n, m, y, a, b; cin >> n >> m >> y; a=0; b=0; for(x=0; x<(m-1); x++){ a=pow(x,n); if (y==(a%m)){ cout << x << " "; b++; } } if (b==0) cout << "-1"; } Edited by author 08.04.2005 00:17 |
|
|