結果

問題 No.2751 429-like Number
ユーザー a01sa01to
提出日時 2024-05-13 00:13:12
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 574 bytes
コンパイル時間 2,908 ms
コンパイル使用メモリ 243,548 KB
実行使用メモリ 10,148 KB
最終ジャッジ日時 2024-12-20 09:17:34
合計ジャッジ時間 28,503 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 21 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  int q;
  cin >> q;
  while (q--) {
    ll a;
    cin >> a;
    int cnt = 0;
    for (ll i = 2; i * i <= a; i++) {
      while (a % i == 0) {
        a /= i;
        cnt++;
      }
      if (cnt > 3) break;
    }
    if (a > 1) cnt++;
    cout << (cnt == 3 ? "Yes" : "No") << endl;
  }
  return 0;
}
0