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

Help I got WA test 6
Posted by Juan H 13 Oct 2020 05:26
I got wrong answer beacuse of test 6
Someone please explain what is test 6
Program in C




#include <stdio.h>
#include <math.h>

int main()
{
    long int n,m,y;
    int x,cont=0,aux1;

scanf("%d %d %d",&n,&m,&y);



for (int i = 0; i <=m-1 ; ++i)
{

    aux1=pow(i,n);

    if (aux1%m == y)
    {
        printf("%d ",i);
cont++;

    }


}
if (cont == 0)
{
    printf("-1\n");
}



    return 0;
}

Edited by author 13.10.2020 05:27
Re: Help I got WA test 6
Posted by mosiur 22 Oct 2020 11:59
Use Bigmod.