Submission #4641689
Source Code Expand
s = input() op_cnt = len(s) - 1 ans = [] for i in range(2**op_cnt): op = ['']*op_cnt for j in range(op_cnt): if ((i >> j) & 1): op[op_cnt - 1 - j] = '+' f = s[0] for p, q in zip(op, s[1:]): f += p + q ans.append(f) sums = 0 for i in ans: sums += eval(i) print(sums)
Submission Info
Submission Time | |
---|---|
Task | C - Many Formulas |
User | udonnokimi |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 334 Byte |
Status | AC |
Exec Time | 27 ms |
Memory | 3064 KB |
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 | 26 ms | 3060 KB |
02.txt | AC | 27 ms | 3060 KB |
03.txt | AC | 26 ms | 3060 KB |
04.txt | AC | 17 ms | 3064 KB |
05.txt | AC | 18 ms | 3060 KB |
06.txt | AC | 18 ms | 3060 KB |
07.txt | AC | 26 ms | 3060 KB |
08.txt | AC | 26 ms | 3060 KB |
09.txt | AC | 17 ms | 3060 KB |
10.txt | AC | 17 ms | 3060 KB |
sample_01.txt | AC | 17 ms | 3060 KB |
sample_02.txt | AC | 26 ms | 3060 KB |