結果
問題 | No.2379 Burnside's Theorem |
ユーザー |
![]() |
提出日時 | 2023-07-14 21:26:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 361 bytes |
コンパイル時間 | 1,862 ms |
コンパイル使用メモリ | 193,008 KB |
最終ジャッジ日時 | 2025-02-15 10:37:27 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){ll n;cin >> n;for(ll p = 2; p * p <= n; p++){if(n % p == 0){while(n % p == 0) n /= p;break;}}ll tmp = n;for(ll q = 2; q * q <= n; q++){if(n % q == 0){while(n % q == 0) n /= q;break;}}cout << (n == 1 or tmp == n ? "Yes" : "No") << '\n';}