|
|
вернуться в форумWA#Test1 Послано Madhav 13 июн 2008 01:07 I am getting WA for test case 1.Can any one help me please? this is my code. #include<iostream> long long int modulo(long long int b,long long int p,long long int n) { long long int x=1,y=b; while(p){ if(p&1){ x=(x*y)%n; } y=(y*y)%n; p/=2; } return (x%n); } int main(){ long long int n,m,y; std::cin>>n>>m>>y; for(long long int x=0;x<m-1;x++) if(modulo(x,n,m)==y) std::cout<<x<<" "; if(modulo(m-1,n,m)==y) std::cout<<m-1; puts(""); return 0; } Re: WA#Test1 I have your same proble did you know the meaning of test#1? Re: WA#Test1 Status: input ...... output -1 |
|
|