結果

問題 No.2379 Burnside's Theorem
ユーザー yansi819
提出日時 2024-03-18 12:08:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 4,505 ms
コンパイル使用メモリ 257,156 KB
最終ジャッジ日時 2025-02-20 07:15:13
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;

map<ll, ll> prime_factors(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}

int main() {
  ll N; cin >> N;
  auto res = prime_factors(N);
  if (res.size() <= 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
0