結果
| 問題 |
No.3233 順列判定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-02 14:56:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 632 bytes |
| コンパイル時間 | 734 ms |
| コンパイル使用メモリ | 86,524 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-23 10:14:50 |
| 合計ジャッジ時間 | 2,053 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 WA * 6 RE * 1 |
ソースコード
// 嘘解法04
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull pow_mod(ull a, ull b, ull mod = ((1LL<<62)-1)*2+1) {ull ans=1, now=a; while(b>0){if(b%2) ans=(ans*now)%mod; now=(now*now)%mod; b/=2;} return ans;}
int main() {
ll N, M;
cin >> N >> M;
vector<bool> is_appeared(N);
for(ll i=0; i<N; i++){
ll next = 1;
for(ll 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;
}