結果

問題 No.2751 429-like Number
ユーザー miho-4miho-4
提出日時 2024-05-10 21:59:49
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 497 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 1,689,956 KB
最終ジャッジ日時 2024-05-10 22:00:35
合計ジャッジ時間 11,080 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #


P=[]
prime = [True for i in range(10**8+1)]
p = 2

while (p * p <= 10**8+1):
  if prime[p] ==1:
    P.append(p)
    for i in range(p * 2, 10**8+1, p):
      prime[i] = 0
  p += 1

S=set(P)
l=len(P)
t=int(input())
for _ in range(t):
  n=int(input())
  flag=0
  for i in range(l):
    if n%P[i]==0:
      n//=P[i]
      for j in range(i,l):
        if n%P[j]==0:
          n//=P[j]
          if n in S:
            flag=1
            break
    if flag:
      break
  print("Yes" if flag else "No")
0