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

What is Wrong?
Posted by bekmyrat 7 Dec 2012 23:18
# include <iostream>
#include <cmath>
#include <vector>

using namespace std;
int main()
{
    vector < int > asd;
    int a,b,c,d,e=0;

    cin>>a>>b>>c;

    for(double i=1;i<=999;i++)
    {
        if(i<=b)
        {
            d=pow(i,a);
            if(d%b==c)
                asd.push_back(i);

            else
                e++;
            }
        }
            if(e==b)
                cout<<"-1";
            else
            {
                cout<<asd[0];
                for(int i=1;i<asd.size();i++)
                    cout<<' '<<asd[i];
            }

    getchar();
    getchar();

    return 0;
}
Re: What is Wrong?
Posted by [TH0412]tdson 27 Dec 2012 08:05
I think you should delete lines:
getchar();