結果
問題 |
No.2751 429-like Number
|
ユーザー |
|
提出日時 | 2024-12-25 11:57:14 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 4,233 ms |
コンパイル使用メモリ | 272,284 KB |
実行使用メモリ | 10,020 KB |
最終ジャッジ日時 | 2024-12-25 11:57:45 |
合計ジャッジ時間 | 26,752 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 21 TLE * 1 |
ソースコード
#include <bits/stdc++.h> using i64 = long long; int solve() { i64 n; std::cin >> n; int cnt = 0; for (i64 i = 2; i * i <= n; ++i) { while (n % i == 0) { n /= i; cnt += 1; if (cnt > 3) { std::cout << "No" << '\n'; return 0; } } } if (n > 1) cnt += 1; std::cout << (cnt == 3 ? "Yes" : "No") << '\n'; return 0; } int main() { std::cin.tie(nullptr)->sync_with_stdio(false); int _; std::cin >> _; while (_--) solve(); return 0; }