結果

問題 No.1595 The Final Digit
ユーザー hir355hir355
提出日時 2021-07-09 21:37:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 796 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 75,856 KB
最終ジャッジ日時 2023-09-14 08:02:15
合計ジャッジ時間 2,574 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,660 KB
testcase_01 AC 70 ms
75,780 KB
testcase_02 AC 71 ms
75,856 KB
testcase_03 AC 68 ms
75,792 KB
testcase_04 AC 73 ms
75,836 KB
testcase_05 AC 70 ms
75,764 KB
testcase_06 AC 69 ms
75,712 KB
testcase_07 AC 68 ms
75,844 KB
testcase_08 AC 71 ms
75,764 KB
testcase_09 AC 71 ms
75,704 KB
testcase_10 AC 72 ms
75,832 KB
testcase_11 AC 72 ms
75,696 KB
testcase_12 AC 70 ms
75,740 KB
testcase_13 AC 69 ms
75,788 KB
testcase_14 AC 69 ms
75,692 KB
testcase_15 AC 69 ms
75,752 KB
testcase_16 AC 69 ms
75,692 KB
testcase_17 AC 70 ms
75,712 KB
testcase_18 AC 68 ms
75,668 KB
testcase_19 AC 69 ms
75,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p, q, r, k = map(int, input().split())
t = [[0] * 1000 for _ in range(64)]
for j in range(1000):
    t[0][j] = (j % 10 + j // 10 % 10 + j // 100) % 10 + j * 10 % 1000
for i in range(63):
    for j in range(1000):
        t[i + 1][j] = t[i][t[i][j]]
k -= 3
p %= 10
q %= 10
r %= 10
x = p * 100 + q * 10 + r
for i in range(64):
    if (k >> i) & 1:
        x = t[i][x]
print(x % 10)
0