結果
| 問題 |
No.2751 429-like Number
|
| コンテスト | |
| ユーザー |
kekenx
|
| 提出日時 | 2024-05-26 14:27:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 526 bytes |
| コンパイル時間 | 593 ms |
| コンパイル使用メモリ | 66,600 KB |
| 最終ジャッジ日時 | 2025-02-21 16:45:23 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 4 TLE * 1 -- * 17 |
ソースコード
#include <iostream>
#include <cassert>
using namespace std;
int f(long long x) {
int ret = 0;
while (x % 2 == 0) {
ret++;
x /= 2;
}
if (ret > 3) return -1;
for (long long i = 3; i * i <= x; i += 2) {
while (x % i == 0) {
ret++;
x /= i;
}
if (ret > 3) return -1;
}
if (x > 2) ret++;
return ret;
}
int main() {
int Q; cin >> Q;
while (Q--) {
long long A; cin >> A;
if (f(A) == 3)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
kekenx