Submission #73051783
Source Code Expand
n,k = map(int,input().split())
def ssum(num):
num = str(num)
cnt = 0
for i in num:
cnt += int(i)
return cnt
ans = 0
for i in range(1,n+1):
if ssum(i) == k:
ans += 1
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Digit Sum |
| User | toppoun |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 200 |
| Code Size | 228 Byte |
| Status | AC |
| Exec Time | 72 ms |
| Memory | 108732 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| 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 | 72 ms | 108732 KiB |
| random_02.txt | AC | 70 ms | 108164 KiB |
| random_03.txt | AC | 49 ms | 79604 KiB |
| random_04.txt | AC | 68 ms | 108380 KiB |
| random_05.txt | AC | 58 ms | 99888 KiB |
| random_06.txt | AC | 70 ms | 108592 KiB |
| random_07.txt | AC | 66 ms | 108620 KiB |
| random_08.txt | AC | 69 ms | 108336 KiB |
| random_09.txt | AC | 68 ms | 108036 KiB |
| sample_01.txt | AC | 48 ms | 79732 KiB |
| sample_02.txt | AC | 53 ms | 89036 KiB |
| sample_03.txt | AC | 70 ms | 108040 KiB |