結果
問題 | No.2379 Burnside's Theorem |
ユーザー |
|
提出日時 | 2023-07-14 21:23:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 529 ms |
コンパイル使用メモリ | 64,596 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 06:08:42 |
合計ジャッジ時間 | 1,256 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<iostream>#include<cassert>using namespace std;long f(long N){for(long p=2;p*p<=N;p++)if(N%p==0){while(N%p==0)N/=p;break;}return N;}int main(){ios::sync_with_stdio(false);cin.tie(nullptr);long N;cin>>N;long M=f(N);if(N==M){cout<<"Yes\n";return 0;}N=f(M);if(N==M||N==1){cout<<"Yes\n";return 0;}cout<<"No\n";}