51nod1014【暴力】

直接暴力1e6就好了

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main()
{
    LL a,p;
    int flag;
    scanf("%lld%lld",&p,&a);

    flag=0;
    for(LL i=1;i<p;i++)
    {
        if((i*i)%p==a)
        {
            if(flag) printf(" ");
            printf("%lld",i);
            flag=1;
        }
    }
    if(!flag)
        puts("No Solution\n");
    return 0;
}
posted @ 2016-09-11 16:18  see_you_later  阅读(94)  评论(0编辑  收藏  举报