結果

問題 No.2379 Burnside's Theorem
ユーザー vjudge1
提出日時 2025-02-18 03:53:07
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 3,448 ms
コンパイル使用メモリ 277,196 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-18 03:53:12
合計ジャッジ時間 4,144 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
using namespace std;

#define fastnuces            \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);             \
    int t = 1;

void solve()
{
    int x;
    cin >> x;
    set<int> freq;
    for (int i = 2; i * i <= x; i++)
    {
        while (x % i == 0)
        {
            freq.insert(i);
            x /= i;
        }
    }
    if (x > 1)
        freq.insert(x);
    // for (auto &value : freq)
    //     cout << value << ", ";
    if (freq.size() > 2)
        cout << "No";
    else
        cout << "Yes";
}

signed main()
{
    fastnuces;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
0