|
|
back to board2admins: TLE? why this prog ac? i think u must add maxtest #include <iostream> #include <stdio.h> #include <math.h> using namespace std; int main() { int k,p,x,y; cin >> k >> p; for(int x=0; x<p; x++)for(int y=0; y<=x; y++)if((x*x+y*y)%p==k) { cout << x << " " << y; return 0; } return 0; } |
|
|