結果

問題 No.2751 429-like Number
ユーザー eve__fuyuki
提出日時 2024-05-10 21:47:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 587 bytes
コンパイル時間 1,738 ms
コンパイル使用メモリ 193,136 KB
最終ジャッジ日時 2025-02-21 12:32:19
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 21 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}
int pf(long long a) {
    int res = 0;
    while (a % 2 == 0) {
        a /= 2;
        res++;
    }
    for (long long i = 3; i * i <= a; i += 2) {
        while (a % i == 0) {
            a /= i;
            res++;
        }
    }
    if (a > 1) {
        res++;
    }
    return res;
}
int main() {
    fast_io();
    int t;
    cin >> t;
    for (; t--;) {
        long long a;
        cin >> a;
        cout << (pf(a) == 3 ? "Yes" : "No") << '\n';
    }
}
0