|
|
вернуться в форумPlease Help me, WA#6 This is my code #include <iostream> using namespace std; long long sqr_N(int arg, int Step) { long long Result = 1; for(int i=1; i<=Step; i++) Result *= arg; return Result; } int main() { int N,M,Y; bool check = false; cin >> N >> M >> Y; for(int X=0; X<M; X++) { if(sqr_N(X,N)%M == Y) { cout << X << ' '; check = true; } } if(!check) cout << -1;
return 0; } -------------------------- I can't understand WHY WA#6 Help me somebody Re: Please Help me, WA#6 Послано NiF 27 окт 2012 00:42 Maximum value of type long long is 2^63-1 less than 998^999 |
|
|