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

Common Board

problem # 1110 WA test 4 Why+++++
Posted by Zero Cool 10 Apr 2005 12:57
this is my code:
maybe you give me some advice ar some test to check my programm. Pls.


#include <iostream.h>
#include <math.h>

void main()
{
int x, n, m, y, k;

cin >> n >> m >> y;

for(x=0, k=0; x<=(m-1); x++){
  if (fmod((pow(x,n)), m)==y){
    cout << x << " ";
    k++;
  }
}
  if (0==k) cout << "-1";

}
Re: problem # 1110 WA test 4 Why+++++
Posted by morbidel 11 Apr 2005 14:59
Well, pow(M, N) for M = N = 999 is quite big