Submission #2379004


Source Code Expand

def return_binary(n, s):
    t = bin(n)[2:]
    while s > len(t):
        t = '0' + t
    t = t + '1'
    return t


def add_up(n, b):
    temp = ''
    total = 0
    for x in range(len(n)):
        temp = temp + n[x]
        if b[x] == '1':
            total = total + int(temp)
            temp = ''
    return total


raw_input = input()
length = len(raw_input)
tot = 0

for i in range(2**(length-1)):
    binary = return_binary(i, length-1)
    tot = tot + add_up(raw_input, binary)

print(tot)

Submission Info

Submission Time
Task C - Many Formulas
User Doit
Language Python (3.4.3)
Score 0
Code Size 527 Byte
Status WA
Exec Time 19 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status AC
AC × 11
WA × 1
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 19 ms 3064 KB
02.txt AC 19 ms 3064 KB
03.txt AC 19 ms 3064 KB
04.txt WA 17 ms 3064 KB
05.txt AC 17 ms 3064 KB
06.txt AC 17 ms 3064 KB
07.txt AC 19 ms 3064 KB
08.txt AC 19 ms 3064 KB
09.txt AC 17 ms 3064 KB
10.txt AC 17 ms 3064 KB
sample_01.txt AC 17 ms 3064 KB
sample_02.txt AC 19 ms 3064 KB