結果
| 問題 | No.3233 順列判定 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-02 05:44:04 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 602 bytes |
| 記録 | |
| コンパイル時間 | 1,458 ms |
| コンパイル使用メモリ | 178,888 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-29 07:50:13 |
| 合計ジャッジ時間 | 4,542 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 1 RE * 14 |
ソースコード
// 嘘解法01
#include <iostream>
#include <vector>
#include <cmath>
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 = (ll)(pow(i, M)) % N;
if(is_appeared[next]){
cout << "No" << endl;
return 0;
}
else {
is_appeared[next] = true;
}
}
cout << "Yes" << endl;
return 0;
}