結果

問題 No.2379 Burnside's Theorem
ユーザー yuyu_5510
提出日時 2023-07-14 21:28:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 1,331 ms
コンパイル使用メモリ 167,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 06:17:05
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
    ll n;
    cin >> n;
    ll m = n;
    ll cnt = 0;
    for(ll i = 2;i*i <= n;i++){
        if(m % i != 0) continue;
        cnt++;
        if(cnt > 2){
            cout << "No" << endl;
            return 0;
        }
        while(m % i == 0){
            m /= i;
        }
    }

    if(m > 1){
        cnt++;
        if(cnt > 2){
            cout << "No" << endl;
            return 0; 
        }
    }
    cout << "Yes" << endl;
}
0