1 条题解

  • 0
    #include<iostream>
    #include<cmath>
    using namespace std;
    int main()
    {
        int n,a,i=0,k,s,max;
        cin>>n>>k;
        while(i<k)
        {
            i++;
            cin>>a;
            s=0;
            for(int j=2;j<n;j++)
                if((a*j)%n==1)max=j,s++;
            if(s==1)cout<<max<<' ';
            else cout<<0<<' ';
        }
        return 0;
    }
    
  • 1

信息

ID
1092
难度
1
分类
(无)
标签
递交数
27
已通过
27
通过率
100%
上传者