Submission #73055030


Source Code Expand

N, K = map(int, input().split())

ans = 0
for i in range(1, N+1):
    stri = str(i)
    S = 0
    for j in range(len(stri)):
        S += int(stri[j])
    if S == K:
        ans += 1

print(ans)

Submission Info

Submission Time
Task B - Digit Sum
User Nikitty
Language Python (PyPy 3.11-v7.3.20)
Score 200
Code Size 205 Byte
Status AC
Exec Time 91 ms
Memory 108424 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 91 ms 108224 KiB
random_02.txt AC 80 ms 107928 KiB
random_03.txt AC 60 ms 79264 KiB
random_04.txt AC 81 ms 108092 KiB
random_05.txt AC 67 ms 91192 KiB
random_06.txt AC 85 ms 108424 KiB
random_07.txt AC 77 ms 102528 KiB
random_08.txt AC 82 ms 107960 KiB
random_09.txt AC 81 ms 108192 KiB
sample_01.txt AC 60 ms 79700 KiB
sample_02.txt AC 66 ms 87692 KiB
sample_03.txt AC 80 ms 108192 KiB