Submission #73077708
Source Code Expand
N = int(input())
A = list(map(int, input().split()))
arr = [0] * (max(A) + 1)
for a in A:
arr[a - 1] += 1
for i in range(len(arr)-2, -1, -1):
arr[i] += arr[i + 1]
carry = 0
for i in range(len(arr)-1):
if arr[i] >= 10:
carry = arr[i] // 10
arr[i] = arr[i] % 10
arr[i + 1] += carry
else:
carry = 0
carry = arr.pop()
while carry > 0:
arr.append(carry % 10)
carry //= 10
arr.reverse()
print(''.join(map(str, arr)))
Submission Info
| Submission Time | |
|---|---|
| Task | D - Many Repunit Sum |
| User | myuuuu |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 400 |
| Code Size | 492 Byte |
| Status | AC |
| Exec Time | 93 ms |
| Memory | 143364 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 400 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt |
| All | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 2_1.txt, 2_2.txt, 2_3.txt, 2_4.txt, 2_5.txt, 2_6.txt, 2_7.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_sample_1.txt | AC | 49 ms | 79848 KiB |
| 0_sample_2.txt | AC | 49 ms | 79672 KiB |
| 0_sample_3.txt | AC | 49 ms | 79796 KiB |
| 1_01.txt | AC | 91 ms | 141128 KiB |
| 1_02.txt | AC | 91 ms | 141188 KiB |
| 1_03.txt | AC | 91 ms | 141204 KiB |
| 1_04.txt | AC | 90 ms | 140968 KiB |
| 1_05.txt | AC | 90 ms | 141064 KiB |
| 1_06.txt | AC | 90 ms | 140892 KiB |
| 1_07.txt | AC | 91 ms | 140864 KiB |
| 1_08.txt | AC | 91 ms | 141408 KiB |
| 1_09.txt | AC | 90 ms | 141072 KiB |
| 1_10.txt | AC | 91 ms | 141140 KiB |
| 1_11.txt | AC | 90 ms | 140936 KiB |
| 1_12.txt | AC | 91 ms | 140924 KiB |
| 1_13.txt | AC | 90 ms | 140868 KiB |
| 1_14.txt | AC | 91 ms | 141424 KiB |
| 1_15.txt | AC | 90 ms | 140928 KiB |
| 1_16.txt | AC | 91 ms | 141008 KiB |
| 1_17.txt | AC | 92 ms | 141544 KiB |
| 1_18.txt | AC | 93 ms | 141144 KiB |
| 1_19.txt | AC | 93 ms | 140964 KiB |
| 1_20.txt | AC | 92 ms | 141240 KiB |
| 2_1.txt | AC | 73 ms | 124724 KiB |
| 2_2.txt | AC | 74 ms | 124360 KiB |
| 2_3.txt | AC | 91 ms | 143364 KiB |
| 2_4.txt | AC | 83 ms | 135616 KiB |
| 2_5.txt | AC | 50 ms | 79652 KiB |
| 2_6.txt | AC | 58 ms | 95104 KiB |
| 2_7.txt | AC | 58 ms | 91560 KiB |