Submission #31708460
Source Code Expand
s = input()
answer = 0
for i in range(1 << len(s) - 1):
current_sum = 0
current_num = int(s[0])
for j in range(len(s) - 1):
if (i >> j) & 1 == 1:
current_sum += current_num
current_num = 0
current_num = current_num * 10 + int(s[j + 1])
answer += current_sum + current_num
print(answer)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Many Formulas |
| User | Pro_ktmr |
| Language | PyPy3 (7.3.0) |
| Score | 300 |
| Code Size | 352 Byte |
| Status | AC |
| Exec Time | 78 ms |
| Memory | 67828 KiB |
Judge Result
| Set Name | Sample | All | ||
|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||
| Status | AC |
|
| Set Name | Test Cases |
|---|---|
| Sample | |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 78 ms | 67804 KiB |
| 02.txt | AC | 61 ms | 67724 KiB |
| 03.txt | AC | 61 ms | 67808 KiB |
| 04.txt | AC | 52 ms | 61404 KiB |
| 05.txt | AC | 52 ms | 61696 KiB |
| 06.txt | AC | 54 ms | 62024 KiB |
| 07.txt | AC | 59 ms | 67620 KiB |
| 08.txt | AC | 60 ms | 67540 KiB |
| 09.txt | AC | 52 ms | 61448 KiB |
| 10.txt | AC | 51 ms | 61536 KiB |
| sample_01.txt | AC | 52 ms | 61736 KiB |
| sample_02.txt | AC | 60 ms | 67828 KiB |