Submission #73051375


Source Code Expand

n, k = map(int, input().split())


def f(n):
    d = [int(i) for i in str(n)]
    return sum(d)


ans = 0
for i in range(1, n + 1):
    if f(i) == k:
        ans += 1
print(ans)

Submission Info

Submission Time
Task B - Digit Sum
User dokinami
Language Python (PyPy 3.11-v7.3.20)
Score 200
Code Size 191 Byte
Status AC
Exec Time 77 ms
Memory 108752 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 77 ms 108464 KiB
random_02.txt AC 75 ms 108752 KiB
random_03.txt AC 47 ms 79560 KiB
random_04.txt AC 75 ms 108660 KiB
random_05.txt AC 65 ms 108568 KiB
random_06.txt AC 77 ms 108656 KiB
random_07.txt AC 72 ms 108608 KiB
random_08.txt AC 77 ms 108424 KiB
random_09.txt AC 77 ms 108464 KiB
sample_01.txt AC 48 ms 80004 KiB
sample_02.txt AC 57 ms 93332 KiB
sample_03.txt AC 77 ms 108728 KiB