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

Discussion of Problem 1110. Power

Madhav WA#Test1 [2] // Problem 1110. Power 13 Jun 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;
}
d000179 Re: WA#Test1 // Problem 1110. Power 2 Apr 2009 20:36
I have your same proble did you know the meaning of test#1?
LittleRock Re: WA#Test1 // Problem 1110. Power 11 Aug 2009 11:44
Status:
input
......

output
-1