Submission #73053564


Source Code Expand

def sum_digit(n):
    return sum(map(int, str(n)))

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

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

print(ans)

Submission Info

Submission Time
Task B - Digit Sum
User gett
Language Python (PyPy 3.11-v7.3.20)
Score 200
Code Size 182 Byte
Status AC
Exec Time 90 ms
Memory 108384 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 89 ms 108380 KiB
random_02.txt AC 88 ms 108384 KiB
random_03.txt AC 59 ms 79728 KiB
random_04.txt AC 88 ms 108036 KiB
random_05.txt AC 73 ms 102708 KiB
random_06.txt AC 89 ms 108180 KiB
random_07.txt AC 83 ms 108320 KiB
random_08.txt AC 89 ms 108064 KiB
random_09.txt AC 89 ms 108344 KiB
sample_01.txt AC 59 ms 79868 KiB
sample_02.txt AC 68 ms 90232 KiB
sample_03.txt AC 90 ms 108380 KiB