求救,样例过了,但提交后测试点都报错“Wrong Answer.wrong answer Too short on line 1."
#include<cstdio>
#include<iostream>
using namespace std;
typedef long long int LL;
inline LL quick_pow(LL a,LL b, LL p){
LL res=1;
while(b)
{
if(b&1) res=res*a%p;
a=a*a%p;
b>>=1;
}
return res;
}
inline LL gcd(LL a, LL b)
{
if(b==0) return a;
else return gcd(b,a%b);
}
int main(void)
{
LL t,n,p,a;
scanf("%d%d",&n,&p);
for(a=1;a<=n;a++){
if(gcd(a,p)==1) printf("%lld\n",quick_pow(a,p-2,p));
else cout<<"impossible"<<endl;
}
}