s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s251807476 | p03545 | u527261492 | 1570496448 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 354 | n=input().split()
a=int(n[0])
b=int(n[1])
c=int(n[2])
d=int(n[3])
if a+b+c+d==7:
print('a+b+c+d=7')
if a+b+c-d==7:
print('a+b+c-d=7')
if a+b-c+d==7:
print('a+b-c+d=7')
if a-b+c+d==7:
print('a-b+c+d=7')
if a+b-c-d==7:
print('a+b-c-d=7')
if a-b+c-d==7:
print('a-b+c-d=7')
if a-b-c+d==7:
print('a-b-c+d=7')
if... |
s886931590 | p03545 | u527261492 | 1570496312 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 316 | n=input()
a=int(n[0])
b=int(n[1])
c=int(n[2])
d=int(n[3])
if a+b+c+d==7:
print(a+b+c+d=7)
if a+b+c-d==7:
print(a+b+c-d)
if a+b-c+d==7:
print(a+b-c+d)
if a-b+c+d==7:
print(a-b+c+d)
if a+b-c-d==7:
print(a+b-c-d)
if a-b+c-d==7:
print(a-b+c-d)
if a-b-c+d==7:
print(a-b-c+d)
if a-b-c-d==7:
print(a-b-c-d)
|
s919733745 | p03545 | u527261492 | 1570496228 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 290 | a,b,c,d=map(int,input().split())
if a+b+c+d==7:
print(a+b+c+d=7)
if a+b+c-d==7:
print(a+b+c-d)
if a+b-c+d==7:
print(a+b-c+d)
if a-b+c+d==7:
print(a-b+c+d)
if a+b-c-d==7:
print(a+b-c-d)
if a-b+c-d==7:
print(a-b+c-d)
if a-b-c+d==7:
print(a-b-c+d)
if a-b-c-d==7:
print(a-b-c-d) |
s755340209 | p03545 | u086716588 | 1570394658 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 759 | def main():
li = [int(i) for i in input()]
t = li[1:]
op = ["+", "+", "+"]
t_sum = sum(t)
if t_sum == 7:
print("{}+{}+{}+{}=7".format(t[0], t[1], t[2], t[3]))
else:
for i in range(3):
if t_sum - 2*t[i] == 7:
op[i] = "-"
print("{}{}{}{}{... |
s163306827 | p03545 | u841621946 | 1569975510 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 588 | s = input()
S = [0]*len(s)
for i in range(len(s)):
S[i] = int(s[i])
# 0:-, 1:+
for i in range(2**len(op)):
op = [0]*(len(S) - 1)
for j in range(len(op)):
if (i >> j & 1):
op[j] = 1
tmp = S[0]
for j in range(len(op)):
if op[j] == 0:
tmp -= S[j+1]
else:
... |
s494795926 | p03545 | u100858029 | 1569624492 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 337 | def conv(c): return '+' if c==1 else '-'
def main():
num = [int(c) for c in input()]
choices = [-1,1]
for a in choices:
for b in choices:
for c in choices:
if num[0]+num[1]*a+num[2]*b+num[3]*c==7:
print("{}{}{}{}{}{}{}=7".format(num[0],conv(a),num[1],conv(b),num[2],conv(c),num[3]))
... |
s625133783 | p03545 | u024768467 | 1569129949 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 546 | n_str = input()
op_count = len(n) - 1 # すき間の個数
for i in range(2 ** op_count):
op_list = ["-"] * op_count # あらかじめ ["-", "-", "-"] というリストを作っておく
for j in range(op_count): # iの右からj+1番目のbitが1かどうかを確認
if ((i >> j) & 1):
op_list[len(op_list) - 1 -j] = "+"
op_list.append("")
formula ... |
s468072799 | p03545 | u539517139 | 1568945941 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 431 | s=input()
a=int(s[0]);b=int(s[1]);c=int(s[2]);d=int(s[3])
if a+b+c+d==7:
print(f'{a}+{b}+{c}+{d}=7')
elif a+b+c-d==7:
print(f'{a}+{b}+{c}-{d}=7')
elif a+b-c+d==7:
print(f'{a}+{b}-{c}+{d}=7')
elif a-b+c+d==7:
print(f'{a}-{b}+{c}+{d}=7')
elif a+b-c-d==7:
print(f'{a}+{b}-{c}-{d}=7')
elif a-b+c-d==7:
print(f'{a... |
s185857461 | p03545 | u097317219 | 1568797089 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 204 | s = input()
def dfs(i,f,sum):
if i == 3:
if sum == 7:
print(f + "=7")
exit()
dfs(i+1,f + "+" + s[i+1],sum+int(s[i+1]))
dfs(i+1,f + "-" + s[i+1],sum-int(s[i+1]))
dfs(0,s[0],int(s[0])) |
s242068409 | p03545 | u734876600 | 1568425554 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 444 | s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
op = ["+","-"]
def pc(x,y,op):
if op == "+":
return x + y
elif op == "-":
return x - y
li = []
ope = []
ans = 0
for i in op:
ans = pc(a,b,i)
for j in op:
ans = pc(ans,c,j)
for k in op:
ans = p... |
s448489470 | p03545 | u732870425 | 1568325782 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 265 | S = input()
for i in range(2**3):
formula = ""
for j in range(4):
formula += S[j]
if (i >> j) & 1:
formula += "+"
else:
formula += "-"
if eval(formula) == 7:
print(formula + "=7")
break |
s122396999 | p03545 | u876616721 | 1568237114 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 498 |
#print(x)
y = [int(c) for c in x]
#print(y)
a = y[0]
b = y[1]
c = y[2]
d = y[3]
if a+b+c+d == 7:
print("a+b+c+d=",a+b+c+d,sep='')
exit()
if a+b+c-d == 7:
print("a+b+c-d=",a+b+c-d,sep='')
exit()
if a+b-c+d == 7:
print("a+b-c+d=",a+b-c+d,sep='')
exit()
if a-b+c+d == 7:
print("a-b+c+d=7")
exit()
if a-b-c+... |
s864612323 | p03545 | u040067762 | 1567943209 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 455 | abcd=[int(i) for i in input()]
sums=sum(abcd)
dif=sums-7
op =['+', '+', '+']
if sums==7:
pass
elif sums == 11:
indx = abcd.index(2)
op[indx-1] = '-'
elif 18 >= dif > 11:
indx = abcd.index(dif/2)
op[indx-1] = '-'
elif dif > 18:
indxs = [i for i, x in enumerate(abcd) if x == dif/4]
for i, x in enumerate(abc... |
s763249568 | p03545 | u117348081 | 1567875223 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 239 | s = list(input())
for i in range(2**3):
f = (s[0])
for j in range(3):
if (i>>j)&1:
f = f "+"
else:
f = f + "-"
f = f + s[j+1]
if eval(f) == 7:
print(f+"=7")
exit() |
s559078452 | p03545 | u137722467 | 1567238168 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 497 | a, b, c, d = map(int, list(input()))
if a+b+c+d == 7: print(a,"+", b, "+", c, "+", d, sep="")
elif a+b+c-d == 7: print(a,"+", b, "+", c, "-", d, sep="")
elif a+b-c+d == 7: print(a,"+", b, "-", c, "+", d, sep="")
elif a-b+c+d == 7: print(a,"-", b, "+", c, "+", d, sep="")
elif a+b-c-d == 7: print(a,"+", b, "-", c, "-", d... |
s540105117 | p03545 | u104442591 | 1567078267 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 40400 | 120 | s = list(input())
def search(a, b, c, d):
if a+b+c+d == 7:
print(a '+' b '+'c '+' d '=' 7)
search(1, 2, 2, 2) |
s979561482 | p03545 | u897328029 | 1566306785 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 783 | # https://atcoder.jp/contests/abc079/tasks/abc079_c
# C - Train Ticket
a, b, c, d = list(input().split()[0])
a, b, c, d = [int(x) for x in [a, b, c, d]]
# 2 ** 3通りなので全探索でいけそう
is_ok = False
for op1 in [True, False]:
work_1 = a + b if op1 else a - b
for op2 in [True, False]:
work_2 = work_1 + c if op2 ... |
s369386427 | p03545 | u897328029 | 1566306655 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 676 | # https://atcoder.jp/contests/abc079/tasks/abc079_c
# C - Train Ticket
a, b, c, d = list(input().split()[0])
a, b, c, d = [int(x) for x in [a, b, c, d]]
# 2 ** 3通りなので全探索でいけそう
for op1 in [True, False]:
work_1 = a + b if op1 else a - b
for op2 in [True, False]:
work_2 = work_1 + c if op2 else work_1 - ... |
s016010446 | p03545 | u897328029 | 1566306550 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 676 | # https://atcoder.jp/contests/abc079/tasks/abc079_c
# C - Train Ticket
a, b, c, d = list(input().split()[0])
a, b, c, d = [int(x) for x in [a, b, c, d]]
# 2 ** 3通りなので全探索でいけそう
for op1 in [True, False]:
work_1 = a + b if op1 else a - b
for op2 in [True, False]:
work_2 = work_1 + c if op2 else work_1 - ... |
s835583393 | p03545 | u852517668 | 1566022560 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 718 | A = [int(v) for v in input()]
for i in range(2):
total = A[0]
if i == 0:
total += A[1]
else:
total -= A[1]
for j in range(2):
if j == 0:
total += A[2]
else:
total -= A[2]
for k in range(2):
if k == 0:
total += A[3]
else:
total -= A[3]
if total =... |
s157705226 | p03545 | u999799597 | 1565745561 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2580 | 514 | n = input()
op_cnt = len(n) - 1 # すき間の個数
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] = "+" # フラグが立っていた箇所を "+" で上書き
formula = ""
for p_n, p_o in zip(n, op + [""]): # 少々モヤッとする
... |
s060525255 | p03545 | u482019060 | 1565642295 | Python | Python (3.4.3) | py | Runtime Error | 20 | 2940 | 293 | from typing import *
a, b, c, d = list(input())
operators = ["+", "-"]
for op1 in operators:
for op2 in operators:
for op3 in operators:
equation = a+op1+b+op2+c+op3+d
if eval(equation) == 7:
print(equation+"=7")
exit()
|
s381653329 | p03545 | u482019060 | 1565642144 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 270 | a, b, c, d = input().split()
operators = ["+", "-"]
for op1 in operators:
for op2 in operators:
for op3 in operators:
equation = a+op1+b+op2+c+op3+d
if eval(equation) == 7:
print(equation+"=7")
exit() |
s928301138 | p03545 | u787059958 | 1565461768 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 629 | i = int(input())
lst = []
while i > 0:
lst.append(i%10)
i //= 10
lst.reverse()
a=lst[0]
b=lst[1]
c=lst[2]
d=lst[3]
sa=str(a)
sb=str(b)
sc=str(c)
sd=str(d)
if(a+b+c+d==7):
print(sa+"+"+sb+"+"+sc+"+"+sd+"=7")
elif (a+b+c-d==7):
print(sa+"+"+sb+"+"+sc+"-"+sd+"=7")
elif (a+b-c+d==7):
print(sa+"+"+sb+"... |
s337644980 | p03545 | u787059958 | 1565461671 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 650 | i = int(input())
lst = []
while i > 0:
lst.append(i%10)
i //= 10
lst.reverse()
a=lst[0]
b=lst[1]
c=lst[2]
d=lst[3]
sa=str(a)
sb=str(b)
sc=str(c)
sd=str(d)
if(a+b+c+d==7):
print(sa+"+"+sb+"+"+sc+"+"+sd+"=7")
elif (a+b+c-d==7):
print(sa+"+"+sb+"+"+sc+"-"+sd+"=7")
elif (a+b-c+d==7):
print(sa+"+"+sb+"... |
s329699195 | p03545 | u716530146 | 1565389519 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | a,b,c,d=[x for x in input()]
op='+-'
for op1 in op:
for op2 in op:
for op3 in op:
ans=A+op1+B+op2+C+op3+D
if eval(ans)==7:
print('{}=7'.format(ans))
exit()
else:
pass |
s876539656 | p03545 | u716530146 | 1565389493 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 218 | a,b,c,d=[x for x in input()]
op='+-'
for op1 in op:
for op2 in op:
for op3 in op:
ans=A+op1+B+op2+C+op3+D
if eval(ans)==7:
print('{}=7'.format(ans))
sys.exit()
else:
pass |
s617062767 | p03545 | u626337957 | 1564375622 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 449 | A, B, C, D = map(int, input().split())
opes = ['-', '+']
for op1 in opes:
for op2 in opes:
for op3 in opes:
result = 0
if op1 == '-':
result += A-B
else:
result += A+B
if op2 == '-':
result -= C
else:
result += C
if op3 == '-':
result -= ... |
s332529541 | p03545 | u626337957 | 1564375582 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 460 | A, B, C, D = map(int, input().split())
opes = ['-', '+']
for op1 in range(2):
for op2 in range(2):
for op3 in range(2):
result = 0
if op1 == '-':
result += A-B
else:
result += A+B
if op2 == '-':
result -= C
else:
result += C
if op3 == '-':
... |
s259085285 | p03545 | u868628468 | 1564197476 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 393 | def solve(S):
for a in ['+', '-']:
for b in ['+', '-']:
for c in ['+', '-']:
if eval('{}{}{}{}{}{}{}'.format(
S[0], a, S[1], b, S[2], c, S[3]
)) == 7:
return '{}{}{}{}{}{}{}=7'.format(
S[0], a, S[... |
s753726381 | p03545 | u868628468 | 1564197166 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 339 | def solve(S):
for a in ['+', '-']:
for b in ['+', '-']:
for c in ['+', '-']:
if eval(
S[0]+ a+ S[1]+ b+ S[2]+ c+ S[3]
) == 7:
return S[0]+ a+ S[1]+ b+ S[2]+ c+ S[3]+ '=7'
S... |
s986960683 | p03545 | u868628468 | 1564195630 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 294 | def solve( ):
for a in ["+", "-"]:
for b in ["+", "-"]:
for c in ["+", "-"]:
if eval('S[0] + a + S[1] +b + S[2] + c + S[3]') == 7:
return 'S[0] + a + S[1] +b + S[2] + c + S[3]=7'
break
S = input()
print(solve(S)) |
s267080140 | p03545 | u868628468 | 1564195547 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 293 | def solve( ):
for a in ["+", "-"]:
for b in ["+", "-"]:
for c in ["+", "-"]:
if eval('S[0] + a + S[1] +b + S[2] + c + S[3]) == 7:
return 'S[0] + a + S[1] +b + S[2] + c + S[3]=7'
break
S = input()
print(solve(S))
|
s786068472 | p03545 | u623687794 | 1564101479 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 671 | s=input()
a=int(s[0]);b=int(s[1]);c=int(s[2]);d=int(s[3])
if a+b+c+d==7:
print(str(a)+"+"str(b)+"+"str(c)+"+"+str(d)+"=7")
break
elif a+b+c-d==7:
print(str(a)+"+"str(b)+"+"str(c)+"-"+str(d)+"=7")
break
elif a+b-c+d==7:
print(str(a)+"+"str(b)+"-"str(c)+"+"+str(d)+"=7")
break
elif a+b-c-d==7:
print(str(a)+"... |
s805372775 | p03545 | u821432765 | 1564069705 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 465 | A, B, C, D = [int(i) for i in list(input())]
ans = 0
ans = f"{A}+{B}+{C}+{D}=7" if A+B+C+D==7 else ans
ans = f"{A}+{B}+{C}-{D}=7" if A+B+C-D==7 else ans
ans = f"{A}+{B}-{C}+{D}=7" if A+B-C+D==7 else ans
ans = f"{A}+{B}-{C}-{D}=7" if A+B-C-D==7 else ans
ans = f"{A}-{B}+{C}+{D}=7" if A-B+C+D==7 else ans
ans = f"{A}-{B}+... |
s885073254 | p03545 | u836939578 | 1563485691 | Python | PyPy3 (2.4.0) | py | Runtime Error | 186 | 38256 | 254 | S=input()
A=int(S[0])
B=int(S[1])
C=int(S[2])
D=int(S[3])
op = ["+","-"]
for i in op:
for j in op:
for k in op:
if eval("A {} B {} C {} D".format(i, j, k)) == 7:
print("{}{}{}{}{}{}{}{}{}".format(A, i, B, j, C, k, D))
exit() |
s603564806 | p03545 | u188244611 | 1562202623 | Python | Python (2.7.6) | py | Runtime Error | 276 | 17780 | 1003 | import numpy as np
N = np.array([int(el) for el in list(input())])
A = np.array([[1,1,1,1],
[1,-1,1,1],[1,1,-1,1],[1,1,1,-1],
[1,-1,-1,1],[1,-1,1,-1],[1,1,-1,-1],
[1,-1,-1,-1]])
B = np.matmul(A, N)
def result(B):
if B[0] == 7:
print("{}+{}+{}+{}=7".format(N[0],N[1]... |
s872406903 | p03545 | u188244611 | 1562202454 | Python | Python (3.4.3) | py | Runtime Error | 150 | 12496 | 1003 | import numpy as np
N = np.array([int(el) for el in list(input())])
A = np.array([[1,1,1,1],
[1,-1,1,1],[1,1,-1,1],[1,1,1,-1],
[1,-1,-1,1],[1,-1,1,-1],[1,1,-1,-1],
[1,-1,-1,-1]])
B = np.matmul(A, N)
def result(B):
if B[0] == 7:
print("{}+{}+{}+{}=7".format(N[0],N[1]... |
s034055562 | p03545 | u886240168 | 1561893788 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 235 | a, b, c, d = map(int, input())
sign = "+-"
for i in range(2):
for j in range(2):
for k in range(2):
if eval(a+sign[i]+b+sign[j]+c+sign[k]+d) == 7:
print(str(a+sign[i]+b+sign[j]+c+sign[k]+d)+"=7") |
s234963456 | p03545 | u374051158 | 1561560118 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 186 | A, B, C, D = input()
for p in itertools.product(['+', '-'], repeat = 3):
equ = A + p[0] + B + p[1] + C + p[2] + D
if(eval(equ) == 7):
print(equ + '=7')
break |
s367565737 | p03545 | u054274920 | 1561313009 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 381 | n = 3
t=[]
for i in range(1<<n):
ans = int(s[0])
k=1
for j in range(n):
if 1&(i>>j):
ans += int(s[k:(j+2)])
t.append("+")
else:
ans -= int(s[k:(j+2)])
t.append("-")
k=j+2
if ans==7:
print(s[0]+t[0]+s[1]+t[1]+s[2]+t[2]+s[3]... |
s078454807 | p03545 | u867005447 | 1561246592 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | a, b, c, d = input()
o = "+-"
for i in range(2 ** 3):
s = a + o[i & 1] + b + o[i & 2] + c + o[i & 4] + d
if eval(s) == 7:
print(s + "=7")
break |
s249897554 | p03545 | u476674388 | 1561245467 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 750 | #!/usr/bin/env python3
import sys
import operator
import itertools
def op(op_str):
funcs = {
"+":operator.add,
"-":operator.sub
}
return funcs[op_str]
def solve(A,B,C,D):
for o in itertools.product(["+","-"], repeat = 3):
ret = op(o[0])(A,B)
ret = op(o[1... |
s475278307 | p03545 | u476674388 | 1561245386 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 731 | #!/usr/bin/env python3
import sys
import operator
import itertools
def op(op_str):
funcs = {
"+":operator.add,
"-":operator.sub
}
return funcs[op_str]
def solve(A,B,C,D):
for o in itertools.product(["+","-"], repeat = 3):
ret = op(o[0])(A,B)
ret = op(o[1... |
s162971439 | p03545 | u333139319 | 1560799405 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38256 | 606 | s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
if a + b + c + d == 7:
print(str(a)+"+"+str(b)+"+"str(c)+"+"str(d)+"=7")
elif a + b + c - d == 7:
print(str(a)+"+"+str(b)+"+"str(c)+"-"str(d)+"=7")
elif a + b - c + d == 7:
print(str(a)+"+"+str(b)+"-"str(c)+"+"str(d)+"=7")
elif a - b + c + d ==... |
s923326547 | p03545 | u062459048 | 1560733001 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 592 | abcd = int(input())
A,B,C,D = abcd[0],abcd[1],abcd[2]abcd[3]
if A + B + C + D == 7:
print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
print('{}+{}-{}-{}=7'.forma... |
s248267798 | p03545 | u062459048 | 1560732807 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 570 | A, B, C, D = map(int, input().split())
if A + B + C + D == 7:
print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A ... |
s465868436 | p03545 | u062459048 | 1560732654 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 593 | A, B, C, D = map(int, raw_input().split())
if A + B + C + D == 7:
print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
print('{}+{}-{}-{}=7'.format(A, B, C, D))
eli... |
s450632649 | p03545 | u062459048 | 1560732508 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 589 | A, B, C, D = map(int, input().split())
if A + B + C + D == 7:
print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7:
print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7:
print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7:
print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A ... |
s543017586 | p03545 | u062459048 | 1560732388 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 587 | A, B, C, D = map(int,input().split())
if A + B + C + D == 7;
print('{}+{}+{}+{}=7'.format(A, B, C, D))
elif A + B + C - D == 7;
print('{}+{}+{}-{}=7'.format(A, B, C, D))
elif A + B - C + D == 7;
print('{}+{}-{}+{}=7'.format(A, B, C, D))
elif A + B - C - D == 7;
print('{}+{}-{}-{}=7'.format(A, B, C, D))
elif A -... |
s299775280 | p03545 | u161271485 | 1560484098 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 405 | def main():
A, B, C, D = list(map(int, list(input().strip())))
for op1 in [-1, 1]:
for op2 in [-1, 1]:
for op3 in [-1, 1]:
if A + (op1 * B) + (op2 * C) + (op3 * D) == 7:
print(f'{A}{"+" if op1 == 1 else "-"}{B}{"+" if op2 == 1 else "-"}{C}{"+" if op3 == 1... |
s421597699 | p03545 | u161271485 | 1560484012 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 324 | A, B, C, D = list(map(int, list(input().strip())))
for op1 in [-1, 1]:
for op2 in [-1, 1]:
for op3 in [-1, 1]:
if A + (op1 * B) + (op2 * C) + (op3 * D) == 7:
print(f'{A}{"+" if op1 == 1 else "-"}{B}{"+" if op2 == 1 else "-"}{C}{"+" if op3 == 1 else "-"}{D}=7')
ex... |
s282045384 | p03545 | u665038048 | 1560465060 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 580 | abcd = input()
a = int(abcd[0])
b = int(abcd[1])
c = int(abcd[-2])
d = int(abcd[-1])
if (a-b-c-d) == 7:
print(f'{a}-{b}-{c}-{d}=7')
exit()
if (a-b+c+d) == 7:
print(f'{a}-{b}+{c}+{d}=7')
exit()
if (a+b+c+d) == 7:
print(f'{a}-{b}-{c}-{d}=7')
exit()
if (a+b-c+d) == 7:
print(f'{a}-{b}-{c}-{d}=7'... |
s974236843 | p03545 | u825842302 | 1560406070 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 350 | lst = list(map(int, input()))
n = len(lst) - 1
op_lst = ["+", "-"]
for i in range(2**n):
op = ["-"] * 3
for j in range(n):
if ((i >> j) & 1):
op[n-j-1] = op_lst[0]
formula = ""
for num,opp in zip(lst, op + [""]):
formula += (num + opp)
if eval(formula) == 7:
print... |
s261079511 | p03545 | u825842302 | 1560406044 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 350 | lst = list(map(int, input()))
n = len(lst) - 1
op_lst = ["+", "-"]
for i in range(2**n):
op = ["-"] * 3
for j in range(n):
if ((i >> j) & 1):
op[n-j-1] = op_lst[0]
formula = ""
for num,opp in zip(lst, op + [""]):
formula += [num + opp]
if eval(formula) == 7:
print... |
s055333452 | p03545 | u193598069 | 1560310495 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 581 | abcd = input()
a = int(abcd[0])
b = int(abcd[1])
c = int(abcd[2])
d = int(abcd[3])
op = ["+", "-"]
for op1 in op:
for op2 in op:
for op3 in op:
val = a
if op1 == "+":
val += b
else:
val -= b
if op2 == "+":
val ... |
s485643076 | p03545 | u170324846 | 1559762543 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 276 | import sys
S = input()
c = 0
op = len(S) - 1 # すき間の個数
for i in range(2 ** op):
T = ""
for j in range(op_cnt):
T += S[j]
if ((i >> j) & 1):
T += "+"
else:
T += "-"
T += S[op_cnt]
if eval(T) == 7:
print(T+"=7")
sys.exit() |
s485186744 | p03545 | u691018832 | 1559505324 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 939 | import sys
input = sys.stdin.readline
abcd = int(input())
a, b, c, d = str(abcd)
a = int(a);b = int(b);c = int(c);d = int(d)
if a+b+c+d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'+'+d+'=7'
elif a+b+c-d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'-'... |
s894290610 | p03545 | u691018832 | 1559504358 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3192 | 925 | import sys
input = sys.stdin.readline
a, b, c, d = input()
ans = 0
a = int(a);b = int(b);c = int(c);d = int(d)
if a+b+c+d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'+'+d+'=7'
elif a+b+c-d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'-'+d+'=7'
elif a... |
s910986964 | p03545 | u691018832 | 1559504236 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 917 | import sys
input = sys.stdin.readline
a, b, c, d = input()
a = int(a);b = int(b);c = int(c);d = int(d)
if a+b+c+d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'+'+d+'=7'
elif a+b+c-d == 7:
a = str(a);b = str(b);c = str(c);d = str(d)
ans = a+'+'+b+'+'+c+'-'+d+'=7'
elif a+b-c-d =... |
s561689991 | p03545 | u669062920 | 1559328448 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 541 | import numpy as np
s = [w for w in input()]
length = len(s)
for i in range(2 ** (length-1)):
b = format(i, 'b')
b_len = len(b)
pad_width = ((length-1) - b_len, 0)
b_pad = np.pad([int(n) for n in b], pad_width, 'constant')
score = int(s[0])
result = s[0]
for flag, num in zip(b_pad, s[1:]):
... |
s817148328 | p03545 | u736729525 | 1559242760 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 132 | from itertools import product as p
A,B,C,D=input();o="+-"
for x in map("".join,p(A,o,B,o,C,o,D)):if eval(x) == 7:print(x+"=7");break |
s482024259 | p03545 | u057109575 | 1558981067 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 488 | a, b, c, d = map(int, input().split())
ans = ''
if a + b + c + d == 7:
ans = '{}+{}+{}+{}=7'
elif a - b + c + d == 7:
ans = '{}-{}+{}+{}=7'
elif a + b - c + d == 7:
ans = '{}+{}-{}+{}=7'
elif a + b + c - d == 7:
ans = '{}+{}+{}-{}=7'
elif a - b - c + d == 7:
ans = '{}-{}-{}+{}=7'
elif a + b - c - d ... |
s305774116 | p03545 | u463655976 | 1558782555 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 204 | ABCD = list(map(int, input()))
op ="+-"
for i in range(pow(2, 3)):
v = i
f = str(ABCD[j])
for j in range(3):
f += op[v%2] + ABCD[j]
v //= 2
if eval(f) == 7:
print("{}=7", f)
break
|
s399445060 | p03545 | u929569377 | 1558398974 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 688 | array = [int(i) for i in list(input())]
flag = False
fugou = ['+', '-']
for i in fugou:
if i == '+':
tmp = array[0] + array[1]
else:
tmp = array[0] - array[1]
for j in fugou:
if j == '+':
tmp2 = tmp + array[2]
else:
tmp2 = tmp - array[2]
for k in fugou:
if k == '+':
if tmp2 + array[3] == 7:
... |
s435775718 | p03545 | u075708555 | 1558222333 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 338 | n = [int(x) for x in input()]
op_cnt = len(n) - 1
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] = "+"
formula = ""
for p_n, p_o in zip(n, op + [""]):
formula += (p_n + p_o)
if eval(formula) == 7:
print(formula +... |
s613996826 | p03545 | u054559808 | 1557685453 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38640 | 653 | a, b, c, d = list(input())
a, b, c, d = int(a), int(b), int(c), int(d)
if a+b+c+d == 7:
print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b+c-d == 7:
print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a+b-c+d == 7:
print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d == 7:
print(str(a... |
s885651773 | p03545 | u054559808 | 1557685354 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38512 | 653 | a, b, c, d = list(input())
a, b, c, d = int(a), int(b), int(c), int(d)
if a+b+c+d == 7:
print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b+c-d == 7:
print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b-c+d == 7:
print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d == 7:
print(str(a... |
s594874384 | p03545 | u152671129 | 1557586119 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 630 | a,b,c,d = map(int, input().split())
if a + b + c + d == 7:
print('{a}+{b}+{c}+{d}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
print('{a}+{b}+{c}-{d}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
print('{a}+{b}-{c}+{d}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
print('{a}+{b}-{c}-{d}=7'.format(a,b,c,d... |
s000023212 | p03545 | u152671129 | 1557586091 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 629 | a,b,c,d = map(int, '1222'.split())
if a + b + c + d == 7:
print('{a}+{b}+{c}+{d}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
print('{a}+{b}+{c}-{d}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
print('{a}+{b}-{c}+{d}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
print('{a}+{b}-{c}-{d}=7'.format(a,b,c,d)... |
s242465654 | p03545 | u470542271 | 1557372125 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 401 | n = list(input().split())
for i in range(2 ** 3):
i2 = bin(i)[2:].zfill(3)
i3 = n[0]
total = int(n[0])
for j in range(3):
if i2[j] == '1':
# plus
total += int(n[j+1])
i3 += '+'
else:
# minus
total -= int(n[j+1])
i3... |
s263726904 | p03545 | u998978987 | 1556316331 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 670 | arr = []
text = input()
for ch in text:
arr.append(int(ch))
arr2 = sorted(arr)
arr2.reverse()
ope = []
def n2opeindex(n):
for i, _n in enumerate(arr):
if n == _n:
return i
return -1
count = 0
for i in arr2:
if count == 0:
count = i
ope.append([i, "+"])
... |
s731827841 | p03545 | u998978987 | 1556316207 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 647 | arr = []
text = input()
for ch in text:
arr.append(int(ch))
arr2 = sorted(arr)
arr2.reverse()
ope = []
def n2opeindex(n):
for i, _n in enumerate(arr):
if n == _n:
return i
return -1
count = 0
for i in arr2:
if count == 0:
count = i
ope.append([i, "+"])
... |
s444296225 | p03545 | u528388170 | 1556055601 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 303 | import sys, ast
def dfs(str_input,count = 1):
if count == 7:
if ast.literal_eval(str_input) == 7:
sys.exit(str_input + "=7")
else:
return 0
for i in ["+","-"]:
dfs(str_input[:count] + i + str_input[count:], count = count + 2)
x = input()
dfs(x) |
s203814614 | p03545 | u528388170 | 1556055481 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 527 | import sys, ast
def dfs(str_input,count = 1):
if count == 7: #演算子を挿入完了
if ast.literal_eval(str_input) == 7:
sys.exit(str_input + "=7")
else: #和が7にならなかった場合は何もしない
return 0
for i in ["+","-"]:
... |
s855494545 | p03545 | u172035535 | 1555828748 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 224 | OP = ['+','-']
ans = 0
for op1 in OP:
for op2 in OP:
for op3 in OP:
if eval(abc[0]+op1+abc[1]+op2+abc[2]+op3+abc[3]) == 7:
ans = abc[0]+op1+abc[1]+op2+abc[2]+op3+abc[3]
print(ans+'=7') |
s670984290 | p03545 | u163320134 | 1555151758 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 439 | s=str(input())
n1=s[0]
n2=s[1]
n3=s[2]
n4=s[3]
sum1=0
sum2=0
sum3=0
ans=''
op=['+','-']
for i in range(2):
if i == 0:
sum1 = n1+n2
else:
sum1 = n1-n2
for j in range(2):
if j == 0:
sum2 = sum1+n3
else:
sum2 = sum1-n3
for k in range(2):
if k == 0:
sum3=sum2+n4
els... |
s589544815 | p03545 | u203377003 | 1555125330 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 618 | N = input()
A, B, C, D = int(N[0]), int(N[1]), int(N[2]), int(N[3])
OP = ["+", "-"]
ANS = A
for op1 in OP:
if ANS == 7:
break
ANS = A
if op1 == "+":
ANS = ANS + B
else:
ANS = ANS - B
for op2 in OP:
if ANS == 7:
Break
if op2 == "+":
ANS... |
s071349260 | p03545 | u168391081 | 1554868250 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 412 | A,B,C,D = map(int,list(input()))
s = (sum([A,B,C,D])-7)//2
c = [1,1,1]
for a,n in enumerate([A,B,C,D]):
if s == n:
c[i] = -1
s = 0
else:
for i in [1,-1]:
for j in [1,-1]:
for k in [1,-1]:
if A+B*i+C*j+D*k == 7:
c[0] = i
c[1] = j
c[2] = k
... |
s530509932 | p03545 | u172035535 | 1554768943 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 228 | import sys
a,b,c,d = input()
pm = ['+','-']
for pm1 in PM:
for pm2 in PM:
for pm3 in PM:
ans = a+pm1+b+pm2+c+pm3+d
if eval(ans) == 7:
print(ans+'=7')
sys.exit() |
s239287734 | p03545 | u442581202 | 1554296410 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 375 | import itertools
s = input()
x = ['+','-']
l = list(itertools.product(x,x,x))
res = int(s[0])
for sign in l:
res = int(s[0])
for i in range(3):
if sign[i] == '+':
res += int(s[i+1])
else:
res -= int(s[i+1])
if res == 7:
print(s[0],end="")
for i in range(3):
print(sign[i],end=... |
s288377933 | p03545 | u298297089 | 1554294031 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 264 | s = [int(i) for i in input()]
op = {'+':1, '-':-1}
for a in op:
for b in op:
for c in op:
if s[0] + op['a'] * s[1] + op['b'] * s[2] + op['c'] * s[3] == 7:
print(str(s[0]) + op['a'] + str(s[1]) + op['b'] + str(s[2]) + op['c'] + str(s[3]) + '=7') |
s856698887 | p03545 | u634513495 | 1554261680 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 399 | N = [int(i) for i in input().split()]
flag = ["","",""]
for i in range(1 << len(N)-1):
print("i:", i)
result = N[0]
for j in range(len(N)-1):
print("j:", j)
if ((i >> j) & 1) == 1:
result += N[j+1]
flag[j] = "+"
else:
result -= N[j+1]
flag[j] = "-"
print("result:", result)
if result == 7:
... |
s125194920 | p03545 | u059210959 | 1554155101 | Python | Python (3.4.3) | py | Runtime Error | 160 | 13616 | 725 | # encoding:utf-8
import copy
import numpy as np
import random
nums = list(input())
nums = [int(i) for i in nums]
def make2digits(n):
digits = []
for i in range(3):
if n % 2 == 1:
digits.append(1)
else:
digits.append(0)
n = n//2
return digits
for i in range(... |
s509883363 | p03545 | u091051505 | 1554144566 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 338 | a,b,c,d = list(input())
a,b,c,d = int(a), int(b), int(c), int(d)
mark = {"+":1,"-":-1}
e = 0
for i, i_ in mark.items():
for j, j_ in mark.items():
for k, k_ in mark.items():
if (e==0)&(a + i_ * b + c * j_ + d * k_ == 7):
print(f"{a}{i}{b}{j}{c}{k}{d}=7")
e = 1
... |
s089549171 | p03545 | u187205913 | 1554061354 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 517 | a,b,c,d = map(int,list(input()))
for i in range(2):
if i==0:
ans=a+b
else:
ans=a-b
for j in range(2):
if j==0:
ans+=c
else:
ans-=c
for k in range(2):
if k==0:
ans+=d
else:
ans-=d
... |
s862628040 | p03545 | u235905557 | 1553889132 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | import sys
A,B,C,D = map(int, input().split())
if A+B+C+D==7:
print("A+B+C+D=7")
sys.exit()
if A-B+C+D==7:
print("A-B+C+D=7")
sys.exit()
if A+B-C+D==7:
print("A+B-C+D=7")
sys.exit()
if A+B+C-D==7:
print("A+B+C-D=7")
sys.exit()
if A-B-C+D==7:
print("A-B-C+D=7")
sys.exit()
if A-B+C... |
s522581743 | p03545 | u235905557 | 1553889058 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 480 | import sys
A,B,C,D = map(int, input().split())
if A+B+C+D==7:
print("A+B+C+D==7")
sys.exit()
if A-B+C+D==7:
print("A-B+C+D==7")
sys.exit()
if A+B-C+D==7:
print("A+B-C+D==7")
sys.exit()
if A+B+C-D==7:
print("A+B+C-D==7")
sys.exit()
if A-B-C+D==7:
print("A-B-C+D==7")
sys.exit()
if... |
s822812438 | p03545 | u548545174 | 1553216587 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 390 | n = [int(x) for x in input()]
#+,-が入る可能性があるのは間だけ
op_cnt = len(n) - 1
for i in range(2 ** op_cnt):
op = ['-'] * op_cnt
for j in range(op_cnt):
if (i >> j) & 1:
op[j] = '+'
formula = ''
for a, b in zip(n, op + ['']):
formula += (a + b)
if eval(formula) == 7:
... |
s295774924 | p03545 | u350049649 | 1552807919 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 173 | S=input()
for i in range(1<<3):
tmp+=S[0]
for j in range(3):
if i>>j&1==1:
tmp+='+'
else:
tmp+='-'
if eval(tmp)==7:
break
print(tmp+'=7')
|
s731891756 | p03545 | u310678820 | 1552771774 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 625 | a, b, c, d = map(int, input().split())
if a+b+c+d==7:
print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b+c-d==7:
print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a+b-c+d==7:
print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d==7:
print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(... |
s306653191 | p03545 | u151625340 | 1552748452 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 683 | def n_ary1(l,d): # リストl中の文字でd桁を全列挙(sorted)
if d == 1:
return(l)
ll = n_ary1(l,d-1)
lll = []
for i in l:
for j in ll:
lll.append(i+j)
#lll.append(int(i+j)) ## n進数の場合
return(lll)
In = list(map(int,input().split()))
op = n_ary1([[0],[1]],3)
for i in op:
s = ... |
s840784753 | p03545 | u030090262 | 1551821500 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 194 | A = input()
op = ["+", "-"]
for bit in range(1 << 3):
ans = A[0]
for i in range(3):
ans += op[bit & (1 << i)]+A[i+1]
if eval(ans) == 7:
print(ans+"=7")
break
|
s992654703 | p03545 | u030090262 | 1551821316 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 194 | A = input()
op = ["+", "-"]
for bit in range(1 << 4):
ans = A[0]
for i in range(3):
ans += op[bit & (1 << i)]+A[i+1]
if eval(ans) == 7:
print(ans+"=7")
break
|
s921371653 | p03545 | u227170240 | 1551565098 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 837 | n = int(input())
a = n // 1000
b = n // 100 - a * 10
c = n // 10 - a * 100 - b * 10
d = n - a * 1000 - b * 100 - c * 10
yet = True
if a+b+c+d==7 and yet:
print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
yet = False
if a+b+c-d==7 and yet:
print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
yet = False... |
s078714014 | p03545 | u013408661 | 1550690624 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 331 | line=str(input())
line=list(line)
a=line[0]
b=line[1]
c=line[2]
d=line[3]
o1='+'
o2='+'
o3='+'
for x in (a+b,a-b):
for y in (c,-c):
for z in (d,-d):
if x+y+z==7:
if x==a-b:
o1='-'
if y==-c:
o2='-'
if z==-d:
o3='-'
print("{}{}{}{}{}{}{}=7".format(a,o1,b,o... |
s036773844 | p03545 | u013408661 | 1550690573 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 304 | line=str(input())
line=list(line)
a,b,c,d=line
o1='+'
o2='+'
o3='+'
for x in (a+b,a-b):
for y in (c,-c):
for z in (d,-d):
if x+y+z==7:
if x==a-b:
o1='-'
if y==-c:
o2='-'
if z==-d:
o3='-'
print("{}{}{}{}{}{}{}=7".format(a,o1,b,o2,c,o3,d))
|
s033803872 | p03545 | u013408661 | 1550690338 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 290 | a,b,c,d=map(int,input().split())
o1='+'
o2='+'
o3='+'
for x in (a+b,a-b):
for y in (c,-c):
for z in (d,-d):
if x+y+z==7:
if x==a-b:
o1='-'
if y==-c:
o2='-'
if z==-d:
o3='-'
print("{}{}{}{}{}{}{}=7".format(a,o1,b,o2,c,o3,d))
|
s269549251 | p03545 | u013408661 | 1550690266 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 287 | a,b,c,d=map(int,input().split())
o1='+'
o2='+'
o3='+'
for x in (a+b,a-b):
for y in (c,-c):
for z in (d,-d):
if x+y+z==7:
if x==a-b:
o1='-'
if y==-c:
o2='-'
if z==-d:
o3='-'
print("{}{}{}{}{}{}{}".format(a,o1,b,o2,c,o3,d)) |
s358690540 | p03545 | u602850810 | 1550541286 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38512 | 317 | abcd = input()
for mask in range(1 << 3):
res = int(abcd[0])
ans = abcd[0]
for i in range(3):
if ((mask >> i) & 1) == 1:
res += int(abcd[i + 1])
ans += '+' + abcd[i + 1]
else:
res -= int(abcd[i + 1])
ans -= '-' + abcd[i + 1]
if res == 7:
print('{}=7', ans)
break |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.