結果
| 問題 |
No.2785 四乗足す四の末尾の0
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-14 21:48:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 512 bytes |
| コンパイル時間 | 363 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 144,468 KB |
| 最終ジャッジ日時 | 2024-06-14 21:48:47 |
| 合計ジャッジ時間 | 4,991 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 1 RE * 14 |
ソースコード
prime = [True for i in range(10**7+1)]
def sieve_of_eratosthenes(n):
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
sieve_of_eratosthenes(10**6+1)
n=int(input())
for _ in range(n):
x=int(input())
p=x**4+4
if x<=20:
if prime[p]:
print("Yes")
else:
print("No")
else:
print("No")
s=str(p)
cnt=0
for i in range(len(s))[::-1]:
if s[i]=="0":
cnt+=1
else:
break
print(cnt)