結果
問題 |
No.2751 429-like Number
|
ユーザー |
|
提出日時 | 2024-06-02 05:20:44 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 821 bytes |
コンパイル時間 | 509 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 153,728 KB |
最終ジャッジ日時 | 2024-12-22 23:07:28 |
合計ジャッジ時間 | 66,279 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 11 TLE * 11 |
ソースコード
# GPT-4o出力ベタ貼り import sys import math def count_prime_factors(n): if n <= 1: return 0 count = 0 # Check for number of 2s while n % 2 == 0: n //= 2 count += 1 # Check for number of odd factors for i in range(3, int(math.sqrt(n)) + 1, 2): while n % i == 0: n //= i count += 1 # If n is a prime number greater than 2 if n > 2: count += 1 return count def main(): input = sys.stdin.read data = input().split() Q = int(data[0]) results = [] for i in range(1, Q + 1): A = int(data[i]) if count_prime_factors(A) == 3: results.append("Yes") else: results.append("No") print("\n".join(results)) if __name__ == "__main__": main()