提出 #73053564


ソースコード 拡げる

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)

提出情報

提出日時
問題 B - Digit Sum
ユーザ gett
言語 Python (PyPy 3.11-v7.3.20)
得点 200
コード長 182 Byte
結果 AC
実行時間 90 ms
メモリ 108384 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 12
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
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