Submission #4640897


Source Code Expand

s = input()
op = ['','+']
if len(s) == 1:
    print(s)
else:
    s = s + 'X'*(10 -len(s))
    ans = []
    for a in op:
        for b in op:
            for c in op:
                for d in op:
                    for e in op:
                        for f in op:
                            for g in op:
                                for h in op:
                                    for i in op:
                                           ans.append(s[0]+a+s[1]+b+s[2]+c+s[3]+d+s[4]+e+s[5]+f+s[6]+g+s[7]+h+s[8]+i+s[9])
    for i in range(len(ans)):
        for j in range(len(ans[i])):
            if ans[i][j] == 'X':
                if ans[i][j-1] == '+':
                    ans[i] = ans[i][:j-1]
                else:
                    ans[i] = ans[i][:j]
                break
    sums = 0
    for i in set(ans):
        sums += eval(i)
    print(sums)

Submission Info

Submission Time
Task C - Many Formulas
User udonnokimi
Language Python (3.4.3)
Score 0
Code Size 899 Byte
Status RE
Exec Time 18 ms
Memory 3064 KB

Judge Result

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