Submission #24015063


Source Code Expand

import sys

input = sys.stdin.readline


def main():
    k = int(input())
    if k % 9 != 0:
        print(0)
        return

    mod = 10 ** 9 + 7
    dp = [1]
    for _ in range(k):
        dp.append(sum(dp[-9:]) % mod)
    print(dp[-1])


if __name__ == "__main__":
    main()

Submission Info

Submission Time
Task 042 - Multiple of 9(★4)
User riantkb
Language Python (3.8.2)
Score 4
Code Size 280 Byte
Status AC
Exec Time 59 ms
Memory 12588 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 4 / 4
Status
AC × 2
AC × 62
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 10_small_00.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt, 10_small_11.txt, 10_small_12.txt, 10_small_13.txt, 10_small_14.txt, 10_small_15.txt, 10_small_16.txt, 10_small_17.txt, 10_small_18.txt, 10_small_19.txt, 11_large_00.txt, 11_large_01.txt, 11_large_02.txt, 11_large_03.txt, 11_large_04.txt, 11_large_05.txt, 11_large_06.txt, 11_large_07.txt, 11_large_08.txt, 11_large_09.txt, 11_large_10.txt, 11_large_11.txt, 11_large_12.txt, 11_large_13.txt, 11_large_14.txt, 11_large_15.txt, 11_large_16.txt, 11_large_17.txt, 11_large_18.txt, 11_large_19.txt, 99_hand_00.txt, 99_hand_01.txt, 99_hand_02.txt, 99_hand_03.txt, 99_hand_04.txt, 99_hand_05.txt, 99_hand_06.txt, 99_hand_07.txt, 99_hand_08.txt, 99_hand_09.txt, 99_hand_10.txt, 99_hand_11.txt, 99_hand_12.txt, 99_hand_13.txt, 99_hand_14.txt, 99_hand_15.txt, 99_hand_16.txt, 99_hand_17.txt, 99_hand_18.txt, 99_hand_19.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 19 ms 8856 KiB
00_sample_01.txt AC 18 ms 8800 KiB
10_small_00.txt AC 19 ms 8800 KiB
10_small_01.txt AC 17 ms 8868 KiB
10_small_02.txt AC 23 ms 8876 KiB
10_small_03.txt AC 20 ms 8940 KiB
10_small_04.txt AC 23 ms 8840 KiB
10_small_05.txt AC 18 ms 8928 KiB
10_small_06.txt AC 20 ms 8868 KiB
10_small_07.txt AC 19 ms 8812 KiB
10_small_08.txt AC 26 ms 8844 KiB
10_small_09.txt AC 26 ms 8844 KiB
10_small_10.txt AC 17 ms 8828 KiB
10_small_11.txt AC 22 ms 8824 KiB
10_small_12.txt AC 22 ms 8932 KiB
10_small_13.txt AC 17 ms 8832 KiB
10_small_14.txt AC 20 ms 8852 KiB
10_small_15.txt AC 20 ms 8808 KiB
10_small_16.txt AC 22 ms 8804 KiB
10_small_17.txt AC 21 ms 8836 KiB
10_small_18.txt AC 18 ms 8840 KiB
10_small_19.txt AC 22 ms 8968 KiB
11_large_00.txt AC 54 ms 12396 KiB
11_large_01.txt AC 59 ms 12392 KiB
11_large_02.txt AC 59 ms 12360 KiB
11_large_03.txt AC 55 ms 12332 KiB
11_large_04.txt AC 57 ms 12340 KiB
11_large_05.txt AC 58 ms 12356 KiB
11_large_06.txt AC 56 ms 12344 KiB
11_large_07.txt AC 58 ms 12364 KiB
11_large_08.txt AC 57 ms 12408 KiB
11_large_09.txt AC 56 ms 12368 KiB
11_large_10.txt AC 54 ms 12340 KiB
11_large_11.txt AC 50 ms 12356 KiB
11_large_12.txt AC 55 ms 12412 KiB
11_large_13.txt AC 56 ms 12468 KiB
11_large_14.txt AC 59 ms 12352 KiB
11_large_15.txt AC 59 ms 12356 KiB
11_large_16.txt AC 57 ms 12396 KiB
11_large_17.txt AC 57 ms 12360 KiB
11_large_18.txt AC 57 ms 12404 KiB
11_large_19.txt AC 55 ms 12412 KiB
99_hand_00.txt AC 18 ms 8800 KiB
99_hand_01.txt AC 20 ms 8844 KiB
99_hand_02.txt AC 26 ms 9192 KiB
99_hand_03.txt AC 59 ms 12588 KiB
99_hand_04.txt AC 25 ms 8836 KiB
99_hand_05.txt AC 19 ms 8932 KiB
99_hand_06.txt AC 17 ms 8836 KiB
99_hand_07.txt AC 20 ms 8932 KiB
99_hand_08.txt AC 25 ms 8800 KiB
99_hand_09.txt AC 26 ms 8836 KiB
99_hand_10.txt AC 20 ms 8800 KiB
99_hand_11.txt AC 21 ms 8840 KiB
99_hand_12.txt AC 20 ms 8812 KiB
99_hand_13.txt AC 22 ms 8928 KiB
99_hand_14.txt AC 21 ms 8856 KiB
99_hand_15.txt AC 22 ms 8808 KiB
99_hand_16.txt AC 20 ms 8844 KiB
99_hand_17.txt AC 24 ms 8840 KiB
99_hand_18.txt AC 18 ms 8836 KiB
99_hand_19.txt AC 19 ms 8844 KiB