結果

問題 No.2269 eN!の整数部分の下1桁
ユーザー titiatitia
提出日時 2023-04-14 22:52:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,463 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-18 20:27:28
合計ジャッジ時間 8,720 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,496 KB
testcase_01 AC 25 ms
10,496 KB
testcase_02 AC 24 ms
10,624 KB
testcase_03 AC 24 ms
10,624 KB
testcase_04 AC 24 ms
10,624 KB
testcase_05 AC 24 ms
10,624 KB
testcase_06 AC 29 ms
10,496 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 29 ms
10,624 KB
testcase_09 AC 26 ms
10,624 KB
testcase_10 AC 26 ms
10,624 KB
testcase_11 AC 26 ms
10,624 KB
testcase_12 AC 27 ms
10,496 KB
testcase_13 AC 27 ms
10,496 KB
testcase_14 AC 25 ms
10,624 KB
testcase_15 AC 29 ms
10,496 KB
testcase_16 AC 44 ms
10,496 KB
testcase_17 AC 158 ms
10,496 KB
testcase_18 AC 1,384 ms
10,624 KB
testcase_19 AC 1,463 ms
10,624 KB
testcase_20 AC 1,419 ms
10,624 KB
testcase_21 AC 1,408 ms
10,624 KB
testcase_22 AC 1,366 ms
10,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for tests in range(T):
    N=int(input())

    if N==0:
        print(2)
        continue

    ANS=0
    now=1
    x=N%10

    for i in range(20):
        ANS+=now
        now*=x
        x-=1

        now%=10
        x%=10

    print(ANS%10)
0