結果

問題 No.1595 The Final Digit
ユーザー ntudantuda
提出日時 2021-07-22 15:46:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 71,396 KB
最終ジャッジ日時 2023-09-24 14:11:11
合計ジャッジ時間 3,081 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,068 KB
testcase_01 AC 72 ms
71,064 KB
testcase_02 AC 72 ms
71,176 KB
testcase_03 AC 75 ms
71,060 KB
testcase_04 AC 72 ms
71,180 KB
testcase_05 AC 70 ms
71,268 KB
testcase_06 AC 71 ms
71,236 KB
testcase_07 AC 70 ms
71,396 KB
testcase_08 AC 71 ms
71,064 KB
testcase_09 AC 72 ms
71,076 KB
testcase_10 AC 71 ms
71,256 KB
testcase_11 AC 71 ms
71,060 KB
testcase_12 AC 71 ms
70,924 KB
testcase_13 AC 69 ms
71,180 KB
testcase_14 AC 70 ms
71,152 KB
testcase_15 AC 69 ms
71,200 KB
testcase_16 AC 69 ms
71,156 KB
testcase_17 AC 69 ms
71,396 KB
testcase_18 AC 68 ms
71,148 KB
testcase_19 AC 69 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
p,q,r,K = map(int,input().split())

if K < 4:
    print([p,q,r][K-1])
    sys.exit()
K -= 4
K %= 124
A = [p%10,q%10,r%10]
for i in range(K+1):
    a = sum(A) % 10
    A = A[1:] + [a]
print(a)
0