結果

問題 No.3233 順列判定
ユーザー YY-otter
提出日時 2024-06-02 15:03:29
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-23 10:14:55
合計ジャッジ時間 1,686 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

// 嘘解法05
#include <iostream>
#include <vector>

using namespace std;
typedef unsigned long long ull;

int main() {
  ull N, M;
  cin >> N >> M;

  vector<bool> is_appeared(N);

  for(ull i=0; i<N; i++){
    ull next = 1;
    for(ull j=0; j<M; j++){
      next *= i;
    }
    next %= N;
    if(is_appeared[next]){
      cout << "No" << endl;
      return 0;
    }
    else {
      is_appeared[next] = true;
    }
  }

  cout << "Yes" << endl;
  return 0;
}
0