結果
| 問題 |
No.2785 四乗足す四の末尾の0
|
| コンテスト | |
| ユーザー |
inksamurai
|
| 提出日時 | 2024-06-18 23:39:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,782 ms / 2,000 ms |
| コード長 | 280 bytes |
| コンパイル時間 | 262 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-18 23:39:26 |
| 合計ジャッジ時間 | 9,682 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
t=int(input())
for _ in range(t):
n=int(input())
if abs(n)==1:
print('Yes')
else:
print('No')
x=abs(n)
ans=0
l,r=0,36
opt=0
while l<=r:
m=(l+r)//2
p=10**m
y=1
for j in range(4):
y*=x
y%=p
y+=4
if y%p==0:
opt=m
l=m+1
else:
r=m-1
print(opt)
inksamurai