結果
問題 | No.2379 Burnside's Theorem |
ユーザー |
![]() |
提出日時 | 2023-07-14 21:21:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 571 bytes |
コンパイル時間 | 1,914 ms |
コンパイル使用メモリ | 196,792 KB |
最終ジャッジ日時 | 2025-02-15 10:26:59 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef LOCAL#include "settings/debug.cpp"#define _GLIBCXX_DEBUG#else#define Debug(...) void(0)#endifusing ll = long long;#define rep(i, n) for (int i = 0; i < (n); ++i)int main() {ll n;cin >> n;vector<pair<int, int>> pf(0);for (ll x = 2; x * x <= n; ++x) {if (n % x != 0) continue;int cnt = 0;while (n % x == 0) {n /= x;++cnt;}pf.push_back({ x, cnt });}if (n != 1) pf.push_back({ n, 1 });cout << (pf.size() <= 2 ? "Yes" : "No") << endl;return 0;}