結果

問題 No.3233 順列判定
ユーザー ゼリトキ
提出日時 2025-08-15 21:40:30
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 207 ms / 1,000 ms
コード長 485 bytes
コンパイル時間 3,385 ms
コンパイル使用メモリ 278,256 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2025-08-15 21:42:10
合計ジャッジ時間 6,571 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
const long long mod=998244353;
const long long hmod=46216567629137;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    int N,M;
    cin>>N>>M;
    ll A[N+1];
    set<int>ans;
    for(int i=1;i<=N;i++){
        ll c=1;
        for(int j=1;j<=M;j++) c=(c*i)%N;
        ans.insert(c);
    }
    if(ans.size()==N) cout<<"Yes\n";
    else cout<<"No\n";
}
0