結果

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

ソースコード

diff #

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

int main() {
  long long n;
  cin >> n;

  map<long long, int> counts;

  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      counts[i]++;
      n /= i;
    }
  }

  if (n > 1) {
    counts[n]++;
  }

  cout << (counts.size() <= 2? "Yes" : "No") << '\n';
  return 0;
}

0