結果
問題 | No.1595 The Final Digit |
ユーザー | Shirotsume |
提出日時 | 2021-07-09 22:00:34 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 1,539 ms |
コンパイル使用メモリ | 86,952 KB |
実行使用メモリ | 79,012 KB |
最終ジャッジ日時 | 2023-09-14 09:02:12 |
合計ジャッジ時間 | 2,996 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 67 ms
71,392 KB |
testcase_01 | RE | - |
testcase_02 | AC | 65 ms
71,264 KB |
testcase_03 | AC | 65 ms
71,296 KB |
testcase_04 | AC | 68 ms
71,464 KB |
testcase_05 | AC | 65 ms
71,484 KB |
testcase_06 | WA | - |
testcase_07 | AC | 63 ms
71,364 KB |
testcase_08 | AC | 64 ms
71,312 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | AC | 67 ms
71,188 KB |
testcase_15 | WA | - |
testcase_16 | RE | - |
testcase_17 | AC | 67 ms
71,344 KB |
testcase_18 | AC | 67 ms
71,480 KB |
testcase_19 | AC | 67 ms
71,484 KB |
ソースコード
p, q, r, k = map(int,input().split()) a = [0] * 100 a[0] = p % 10 a[1] = q % 10 a[2] = r % 10 for i in range(3, 100): x = (a[i - 1] + a[i - 2] + a[i - 3]) % 10 if x in a[4:]: start = a.index(x) end = i a[i] = x break a[i] = x if k <= end: print(a[k - 1]) exit() ind = (k - start) % (end - start) + start - 1 print(a[ind])