結果

問題 No.2785 四乗足す四の末尾の0
ユーザー 高橋ゆに
提出日時 2025-03-18 21:03:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 77,276 KB
最終ジャッジ日時 2025-03-18 21:03:46
合計ジャッジ時間 4,810 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    def test_case(N):
        print('Yes' if (N == 1 or N == -1) else 'No')
        ans = 0
        for k in range(40):
            if (N**4 + 4) % (10**k) == 0:
                ans = k
            else:
                break
        print(ans)
        
    T = int(input())
    for _ in range(T):
        N = int(input())
        test_case(N)

if __name__ == '__main__':
    main()
0