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
s499842076
p03545
u360085167
1585023478
Python
Python (3.4.3)
py
Runtime Error
17
3064
739
ABCD = int(input()) a = int(ABCD//10e2) b = int((ABCD-a*10e2)//10e1) c = int((ABCD-a*10e2-b*10e1)//10) d = int(ABCD-a*10e2-b*10e1-c*10) 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)+...
s365920592
p03545
u339851548
1584304647
Python
Python (3.4.3)
py
Runtime Error
17
2940
261
for i in range(2**(l-1)): f = "" for j in range(l-1): f += s[j] if i & (1 << j): f += "+" else: f += "-" if j == l-2: f += s[l-1] if eval(f)==7: print(f+"=7") break
s505961009
p03545
u004423772
1584203156
Python
Python (3.4.3)
py
Runtime Error
18
3064
575
import sys input = sys.stdin.readline nums = list(map(int, list(input().rstrip('\r')))) ans_op = [''] * 3 for bit in range(2**3): total = 0 tmp = [''] * 3 for i in range(3): if i == 0: total += nums[i] if (bit >> i) & 1: total += nums[i+1] tmp[i] = '+' ...
s534248797
p03545
u446371873
1584154554
Python
Python (3.4.3)
py
Runtime Error
18
3060
254
s = input() l = len(s) ans = 0 for i in range(2**(l-1)): e = "" for j in range(l): if ((i >> j) & 1): e += s[j] + "+" else: e += s[j] + "-" if eval(e) == 7: print('{}=7'.format(e)) break
s931716918
p03545
u446371873
1584154473
Python
Python (3.4.3)
py
Runtime Error
17
3060
239
s = input() l = len(s) ans = 0 for i in range(2**(l-1)): e = "" for j in range(l): if ((i >> j) & 1): e += s[j] + "+" else: e += s[j] + "-" if eval(e) == 7: print(e) break
s901405869
p03545
u264564865
1583983011
Python
Python (3.4.3)
py
Runtime Error
17
3064
348
ABCD = input() A, B, C, D = int(ABCD[0]), int(ABCD[1]), int(ABCD[2]), int(ABCD[3]) oper = ['+', '-'] for op1 in range(2): for op2 in range(2): for op3 in range(2): sum = A + (-1)**op1*B + (-1)**op2*C + (-1)**op3*D if sum == 7: return str(A)+oper[op1]+str(B)+oper[op2]+...
s090424165
p03545
u202570162
1583755462
Python
Python (3.4.3)
py
Runtime Error
17
3064
372
nums=[int(i) for i in input()] ops=[1,-1] for op1 in ops: for op2 in ops: for op3 in ops: if nums[0]+op1*nums[1]+op2*nums[2]+op3*nums[3]==7: ans=''+str(nums[0]) ans+='+' if op1==1 else '-' ans+=str(nums[1]) ans+='+' if op2==1 else '-' ans+=str(nums[2]) ans+='+...
s534459646
p03545
u426683236
1583754226
Python
Python (3.4.3)
py
Runtime Error
18
3060
502
def solve(): n = list(input()) n = [ord(c) - ord('0') for c in n] sign = ['-', '+'] for i in range(2): for j in range(2): for k in range(2): t = n[0] t += n[1] * (i * 2 - 1) t += n[2] * (j * 2 - 1) t += n[3] * (k * 2 - ...
s076530192
p03545
u440161695
1583681104
Python
Python (3.4.3)
py
Runtime Error
18
3064
529
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) exit() if a-b+c+d==7: print(a+"-"+b+"+"+c+"+"+d+"="+7) exit() if a+b-c+d==7: print(a+"+"+b+"-"+c+"+"+d+"="+7) exit() if a+b+c-d==7: print(a+"+"+b+"+"+c+"-"+d+"="+7) exit() if a-b-c+d==7: print(a+"...
s005623590
p03545
u183896397
1582512530
Python
Python (3.4.3)
py
Runtime Error
17
3064
656
X = input() flag = ['+','-'] check = 0 for i in flag: if i == '+': ans = int(X[0]) + int(X[1]) else: ans = int(X[0]) - int(X[1]) if check == 1: break for j in flag: if j == '+': ans += int(X[2]) else: ans -= int(X[2]) if check == 1:...
s105407274
p03545
u183896397
1582512353
Python
Python (3.4.3)
py
Runtime Error
17
3064
497
X = input() flag = ['+','-'] for i in flag: if i == '+': ans = int(X[0]) + int(X[1]) else: ans = int(X[0]) - int(X[1]) for j in flag: if j == '+': ans += int(X[2]) else: ans -= int(X[2]) for k in flag: if k == '+': a...
s584982218
p03545
u183896397
1582512234
Python
Python (3.4.3)
py
Runtime Error
18
3064
489
X = input() flag = ['+','-'] for i in flag: if i == '+': ans = int(X[0]) + int(X[1]) else: ans = int(X[0]) - int(X[1]) for j in flag: if j == '+': ans += int(X[2]) else: ans -= int(X[2]) for k in flag: if k == '+': a...
s230411089
p03545
u840570107
1582432806
Python
Python (3.4.3)
py
Runtime Error
17
2940
2
qq
s735427270
p03545
u112317104
1582348019
Python
Python (3.4.3)
py
Runtime Error
17
2940
706
def solve(): N = list(input().split())[0] a,b,c,d = int(N[0]),int(N[1]),int(N[2]),int(N[3]) if a+b+c+d == 7: print(f'{a}+{b}+{c}+{d}=7') return if a+b+c-d == 7: print(f'{a}+{b}+{c}-{d}=7') return if a+b-c+d == 7: print(f'{a}+{b}-{c}+{d}=7') return...
s007593312
p03545
u863442865
1582339934
Python
Python (3.4.3)
py
Runtime Error
17
2940
532
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(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') exit() if a-b-c+d==7: ...
s468620384
p03545
u391667116
1582175266
Python
Python (3.4.3)
py
Runtime Error
17
3064
598
a, b, c, d = map(int, input().split()) 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='') el...
s071245308
p03545
u548624367
1582071727
Python
Python (3.4.3)
py
Runtime Error
17
3060
301
a=input() op=list("+-") flag = False for i in range(op): for j in range(op): for k in range(op): s = a[0]+i+a[1]+j+a[2]+k+a[3] flag = True if eval(s) == 7: break if flag: break if flag: break print(s+"=7")
s071186547
p03545
u063073794
1581988594
Python
Python (3.4.3)
py
Runtime Error
17
2940
275
a, b, c, d = input() op_choice = ["+", "-"] for op1 in op_choice: for op2 in op_choice: for op3 in op_choice: check = a + op1 + b + op2 + c + op3 + d if eval(check) == 7: print(check + "=7") exit() ​lily
s632631540
p03545
u442877951
1581898444
Python
Python (3.4.3)
py
Runtime Error
18
3064
215
math = input() for i in range(2**3): op = format(i,"03b") op = op.replace('1', '+').replace('0', '-') ans = math[0]+op[0]+math[1]+op[1]+math[2]+op[3]+math[3] if eval(ans) == 7: print(ans+"=7") break
s862702366
p03545
u701318346
1581516328
Python
Python (3.4.3)
py
Runtime Error
18
3188
250
ABCD = input() for i in range(2 ** 3): op = format(i, '03b') op = op.replace('1', '+').replace('0', '-') formula = ABCD[0] + op[0] + ABCD[1] + op[1] + ABCD[2] + op[2] if eval(formula) == 7: print(formula + '=7') break
s472166355
p03545
u826929627
1581459192
Python
Python (3.4.3)
py
Runtime Error
18
3064
499
ABCD = input() A = int(ABCD[0]) B = int(ABCD[1]) C = int(ABCD[2]) D = int(ABCD[3]) for x in range(2): if x == 0: _ = A+B op1 = '+' else: _ = A-B op1 = '-' for y in range(2): if y == 0: _ += C op2 = '+' else: _ -= C op2 = '-' for z in range(2): if ...
s443355063
p03545
u228232845
1581275505
Python
Python (3.4.3)
py
Runtime Error
17
3064
489
def test(): nums = list(map(int, list(input()))) for i in range(2 ** 3): ans = nums[0] res = '{}'.format(nums[0]) for j in range(3): if (i >> j) & 1: ans += nums[j+1] res += '+{}'.format(nums[j+1]) else: ans -= nums[...
s158161898
p03545
u228232845
1581275355
Python
Python (3.4.3)
py
Runtime Error
17
2940
457
def test(): nums = list(map(int, list(input()))) for i in range(2 ** 3): ans = nums[0] res = f'{nums[0]}' for j in range(3): if (i >> j) & 1: ans += nums[j+1] res += f'+{nums[j+1]}' else: ans -= nums[j+1] ...
s224171278
p03545
u113375133
1580959453
Python
Python (3.4.3)
py
Runtime Error
18
3064
328
S = input() total = 0 n = len(S) ans = 0 for i in range(2**(n-1)): form = S bit = [] for _ in range(n-1): bit.append(i%2) i = i // 2 eq = "" for i, b in enumerate(bit): eq += (form[i]) if b == 1: eq += ('+') eq += form[-1] ans += eval(eq) prin...
s491133407
p03545
u103902792
1580951441
Python
Python (3.4.3)
py
Runtime Error
18
3064
318
s = input() def func(ac,s,op): next = s[0] if len(s) ==1: if ac + next == 7: print(str+'+'+s[0]+'=7') exit(0) if ac - next == 7: print(str+'-'+s[0]+'=7') exit(0) else: func(ac+next,s[1:],op+'+'+str(next)) func(ac-next,s[1:],op+'-'+str(next)) func(int(s[0]),s[1:],s[0])
s679465689
p03545
u934052933
1580875683
Python
Python (3.4.3)
py
Runtime Error
17
3064
566
def main(): s = input() n = len(s) l = ["+", "-"] for i in range(2 ** n): pm = [] ans = int(s[0]) for j in range(n): if ((i >> j) & 1): pm.append(l[0]) else: pm.append(l[1]) for k in range(n): if pm[k...
s640434162
p03545
u934052933
1580875611
Python
Python (3.4.3)
py
Runtime Error
17
3064
584
def main(): s = [int(i) for i in input()] n = len(s) l = ["+", "-"] for i in range(2 ** n): pm = [] ans = int(s[0]) for j in range(n): if ((i >> j) & 1): pm.append(l[0]) else: pm.append(l[1]) for k in range(n): ...
s080133086
p03545
u875449556
1580770536
Python
Python (3.4.3)
py
Runtime Error
17
3064
463
S = input() l = list(map(int, S)) s = l[0] p = S[0] for i in range(2**2): a = [0]*3 for j in range(2): if (i >> j & 1): a[2-j] = "+" else: a[2-j]="-" for i in range(2): if a[i] == "+": s += l[i] else: s += (l[i])*-1 f...
s066500734
p03545
u840958781
1580674616
Python
Python (3.4.3)
py
Runtime Error
17
3064
518
a,b,c,d=map(int,input().split()) if a+b+c+d==7: print(a,"+",b,"+",c,"+",d,"=",7,sep="") elif a+b+c-d==7: print(a,"+",b,"+",c,"-",d,"=",7,sep="") elif a+b-c+d==7: print(a,"+",b,"-",c,"+",d,"=",7,sep="") elif a+b-c-d==7: print(a,"+",b,"-",c,"-",d,"=",7,sep="") elif a-b+c+d==7: print(a,"-",b,"+",c,"+",...
s716670738
p03545
u227082700
1580673670
Python
Python (3.4.3)
py
Runtime Error
19
3188
147
a,b,c,d=list(input()) op=lambda i,a:"+" if i&a else "-" for i in range(8): s=a+op(i&1)+e+op(i&2)+c+op(i&4)+d if eval(s)==7:print(s+"=7");exit()
s572547479
p03545
u006167882
1580416751
Python
Python (3.4.3)
py
Runtime Error
17
2940
863
#include <iostream> #include <string> #include <vector> #include <math.h> #include <cstdio> using namespace std; int main() { string s; cin >> s; int a = s[0] - '0', b = s[1] - '0', c = s[2] - '0', d = s[3] - '0'; if (a - b - c - d == 7) printf("%d-%d-%d-%d=7\n", a, b, c, d); else if (a - b...
s106818639
p03545
u608053762
1580082536
Python
Python (3.4.3)
py
Runtime Error
18
3064
833
kippu = [int(i) for i in input().split()] def judge(i, remaining, kigou): if i==4 and remaining==0: return True, kigou elif i==4 and remaining!=0: return False ,kigou else: temp_plus = remaining - kippu[i] temp_minus = remaining + kippu[i] kigou_plus = kigou + ['+'+s...
s156506703
p03545
u239528020
1579981166
Python
Python (3.4.3)
py
Runtime Error
17
3064
834
S = tuple((input())) S = [int(s) for s in S] flag=0 for i in [0,1]: if flag==1: break for j in [0,1]: if flag==1: break for k in [0,1]: value = S[0] if i==0: value+=S[1] else: value-=S[1] if j==0...
s593388888
p03545
u747220349
1579951518
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38384
185
from itertools import product s=input() for b in list(product(["+","-"],repeat=3)): ans=s[0]+b[0]+s[1]+b[1]+s[2]+b[2]+s[3] if evel(ans)==7: print(ans+"7") break
s112815795
p03545
u747220349
1579951450
Python
PyPy3 (2.4.0)
py
Runtime Error
164
38384
182
from itertools import product s=input() for b in list(product["+","-"],repeat=3): ans=s[0]+b[0]+s[1]+b[1]+s[2]+b[2]+s[3] if evel(ans)==7: print(ans+"7") break
s484995436
p03545
u594567187
1579817274
Python
Python (3.4.3)
py
Runtime Error
18
3060
221
nums = [n for n in input()] ope = ["+", "-"] for b in range(2 ** 3): temp = nums[0] for i in range(3): temp += ope[b & (1 << i)] + nums[i + 1] if eval(temp) == 7: print(temp+"=7") break
s716011336
p03545
u594567187
1579817129
Python
Python (3.4.3)
py
Runtime Error
17
2940
225
nums = [n for n in input()] ope = ["+", "-"] for b in range(2 ** 3): temp = nums[0] for i in range(3): temp += f"{ope[b & (1 << i)]}{nums[i + 1]}" if eval(temp) == 7: print(temp+"=7") break
s655053669
p03545
u594567187
1579817091
Python
Python (3.4.3)
py
Runtime Error
17
2940
220
nums = [n for n in input()] ope = ["+", "-"] for b in range(2 ** 3): temp = nums[0] for i in range(3): temp += f"{ope[b & (1 << i)]}{nums[i + 1]}" if eval(temp) == 7: print(temp) break
s995437211
p03545
u427984570
1579661790
Python
Python (3.4.3)
py
Runtime Error
19
3064
588
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(d)+'=7') elif...
s777240293
p03545
u427984570
1579661644
Python
Python (3.4.3)
py
Runtime Error
17
3064
594
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(d)+'=7') e...
s051635994
p03545
u414458988
1578968429
Python
PyPy3 (2.4.0)
py
Runtime Error
163
38384
307
def dfs(i, f, sum, s): if i == 3: if sum == 7: print(f+"=7") exit() dfs(i+1, f+"-"+s[i+1], sum - int(s[i+1]), s) dfs(i+1, f+"+"+s[i+1], sum + int(s[i+1]), s) def main(): s = input() dfs(0, s[0], int(s[0]), s) if __name__ == '__main__': main()
s523274089
p03545
u687053495
1578633388
Python
Python (3.4.3)
py
Runtime Error
18
2940
313
Z = [] for s in input(): Z.append(int(s)) def dfs(index, value, ops): if index == 4: if value == 7: print(f"{Z[0]}{ops[0]}{Z[1]}{ops[1]}{Z[2]}{ops[2]}{Z[3]}=7") exit() return dfs(index + 1, value + Z[index], ops + ["+"]) dfs(index + 1, value - Z[index], ops + ["-"]) dfs(1, Z[0], [])
s896795521
p03545
u196675341
1578544678
Python
Python (3.4.3)
py
Runtime Error
17
3064
469
a, b, c, d = map(int,list(input().strip())) b_case = [b, -b] c_case = [c, -c] d_case = [d, -d] #print(b_case, c_case, d_case) for i in b_case: for j in c_case: for k in d_case: #print(a, i, j, k, a+i+j+k) if a + i + j + k == 7: print('{}{:+}{:+}{:+}{}'.format(a, i,...
s431925860
p03545
u196675341
1578544002
Python
Python (3.4.3)
py
Runtime Error
17
3064
467
a, b, c, d = map(int,list(input().strip())) b_case = [b, -b] c_case = [c, -c] d_case = [d, -d] print(b_case, c_case, d_case) for i in b_case: for j in c_case: for k in d_case: print(a, i, j, k, a+i+j+k) if a + i + j + k == 7: print('{}{:+}{:+}{:+}{}'.format(a, i, j...
s730876067
p03545
u196675341
1578543380
Python
Python (3.4.3)
py
Runtime Error
18
3064
389
a, b, c, d = map(int,list(input().strip())) b_case = [b, -b] c_case = [c, -c] d_case = [d, -d] for i in b_case: for j in c_case: for k in d_case: if a + i + j + k == 7: print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7')) flag = 1 break ...
s503431677
p03545
u196675341
1578543269
Python
Python (3.4.3)
py
Runtime Error
17
3064
398
a, b, c, d = map(int,list(input().strip())) b_case = [b, -b] c_case = [c, -c] d_case = [d, -d] for i in b_case: for j in c_case: for k in d_case: if a + i + j + k == 7: print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7')) flag = True break ...
s473165581
p03545
u196675341
1578542961
Python
Python (3.4.3)
py
Runtime Error
17
3064
408
a, b, c, d = map(int,list(input().strip())) b_case = [b, -b] c_case = [c, -c] d_case = [d, -d] ans = '' for i in b_case: for j in c_case: for k in d_case: if a + i + j + k == 7: print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7')) flag = True brea...
s338122040
p03545
u984276646
1578533249
Python
Python (3.4.3)
py
Runtime Error
17
3060
285
S = input() A = [int(S[i]) for i in range(4)] for i in range(8): p = A[0] s = [] for j in range(3): if i % 2 == 0: p += A[i] s.append('+') else: p -= A[i] s.append('-') i //= 2 if p == 7: print('A[0]s[0]A[1]s[1]A[2]s[2]A[3]=7') break
s805916911
p03545
u951480280
1578108460
Python
Python (3.4.3)
py
Runtime Error
17
3064
303
s=input() n = 2**(len(s)-1) ans="" for i in range(n): t = "" a = str(bin(i))[2:].zfill(len(s)-1) for j in range(len(a)): if a[j] == "1": t += s[j] + "+" else: t += s[j] t += s[-1] if eval(t)==7: ans = t + "=7" break print(ans)
s498041200
p03545
u992910889
1578106735
Python
Python (3.4.3)
py
Runtime Error
17
3060
336
# coding: utf-8 def dfs(i,f,sum):#ストップする段階(i)、式(f)、sumカウンタの3つの引数を用意。 if i == 3: if sum==7: print(f+"=7") exit() return dfs(i+1, f+"+"+s[i+1],sum+int(s[i+1])) dfs(i+1, f+"-"+s[i+1],sum-int(s[i+1])) s=input() dfs(0, s[0],int(s[0]))
s593976452
p03545
u992910889
1578106707
Python
PyPy3 (2.4.0)
py
Runtime Error
173
38768
336
# coding: utf-8 def dfs(i,f,sum):#ストップする段階(i)、式(f)、sumカウンタの3つの引数を用意。 if i == 3: if sum==7: print(f+"=7") exit() return dfs(i+1, f+"+"+s[i+1],sum+int(s[i+1])) dfs(i+1, f+"-"+s[i+1],sum-int(s[i+1])) s=input() dfs(0, s[0],int(s[0]))
s795687611
p03545
u179672048
1578102265
Python
Python (3.4.3)
py
Runtime Error
17
2940
269
def dfs(i, f, sum): if i == 3: if sum == 7: print(f + "=7") exit() else: dfs(i + 1, f + "+" + s[i + 1], sum + int(s[i + 1])) dfs(i + 1, f + "-" + s[i + 1], sum - int(s[i + 1]) s = input() dfs(0, s[0], int(s[0]))
s190226442
p03545
u179672048
1578102188
Python
Python (3.4.3)
py
Runtime Error
17
2940
270
s = input() def dfs(i, f, sum): if i == 3: if sum == 7: print(f + "=7") exit() else: 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]))
s646978635
p03545
u179672048
1578102084
Python
Python (3.4.3)
py
Runtime Error
18
3064
262
s = input() def dfs(i, f, sum): if i == 3: if sum == 7: print(f + "=7") exit() else: dfs(i + 1, f + "+" + s[i + 1], sum + s[i + 1]) dfs(i + 1, f + "-" + s[i + 1], sum - s[i + 1]) dfs(0, s[0], int(s[0]))
s213940551
p03545
u764860452
1577907209
Python
Python (3.4.3)
py
Runtime Error
17
2940
509
A,B,C,D=map(int,list(input()) 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-B-C+D==7: print('{}-{}-{}+{}=7'.format(A...
s642532718
p03545
u492447501
1577540475
Python
Python (3.4.3)
py
Runtime Error
18
3064
359
S = input() A = S[0] B = S[1] C = S[2] D = S[3] for i in range(2**(len(S)-1)): op_list = ['+']*(len(S)-1) for j in range(len(S)-1): if (i>>j)&1: op_list[j]='-' s = "" for j in range(len(S)-1): s = s + S[j] + op_list[j] s = s + S[len(S)-1] if 7==eval(s): p...
s136870847
p03545
u936985471
1576889337
Python
Python (3.4.3)
py
Runtime Error
17
3064
149
s=input() for i in range(2**3): f=s[0] for j in range(3): if i>>j&1: f+="+" f+=s[j+1] if eval(f)==7: print(f+"=7") break
s099329211
p03545
u602677143
1576766448
Python
Python (3.4.3)
py
Runtime Error
17
3064
757
import sys a,b,c,d = map(int,input()) ans = a+b+c+d if ans == 7: print(s[0]+"+"+s[1]+"+"+s[2]+"+"+s[3]+"=7") sys.exit() ans = a+b+c-d if ans == 7: print(s[0]+"+"+s[1]+"+"+s[2]+"-"+s[3]+"=7") sys.exit() ans = a+b-c+d if ans == 7: print(s[0]+"+"+s[1]+"-"+s[2]+"+"+s[3]+"=7") sys.exit() ans = a-b+c+...
s323113164
p03545
u323374686
1576604664
Python
PyPy3 (2.4.0)
py
Runtime Error
183
38512
494
a = input() input_list = [] for k in a: input_list.append(int(k)) ans = [] fomul_list = [] for i in range(2 ** n): sum = input_list[0] fomul = str(input_list[0]) for j in range(3): if (i >> j)&1: sum += input_list[j+1] fomul = fomul + "+" + str(input_list[j+1]) el...
s111347493
p03545
u653792857
1575925250
Python
Python (3.4.3)
py
Runtime Error
17
3064
556
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,...
s173811089
p03545
u920387587
1575766121
Python
Python (3.4.3)
py
Runtime Error
22
3444
579
import sys import copy S = list(map(str, input())) def main(): op_cnt = len(S) - 1 lis=[] 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] = "+" else: op[op_cnt -1 -j]='-' ...
s461731153
p03545
u920387587
1575765464
Python
Python (3.4.3)
py
Runtime Error
22
3444
577
import sys import copy S = list(map(str, input())) def main(): op_cnt = len(S) - 1 lis=[] 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] = "+" else: op[op_cnt -1 -j]='-' ...
s225718465
p03545
u920387587
1575765310
Python
Python (3.4.3)
py
Runtime Error
23
3444
703
import sys import copy S = list(map(str, input())) def main(): op_cnt = len(S) - 1 lis=[] 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] = "+" else: op[op_cnt -1 -j]='-' ...
s248950533
p03545
u920387587
1575765214
Python
Python (3.4.3)
py
Runtime Error
19
3064
675
S = list(map(str, input())) op_cnt = len(S) - 1 def main(): lis=[] 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] = "+" else: op[op_cnt -1 -j]='-' #print(op) S_tm...
s738495713
p03545
u920387587
1575765015
Python
Python (3.4.3)
py
Runtime Error
17
3064
594
S = list(map(str, input())) op_cnt = len(S) - 1 lis=[] eva=[] 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] = "+" else: op[op_cnt -1 -j]='-' #print(op) S_tmp = copy.deepcopy(S) for k in range(len...
s742681319
p03545
u489762173
1575674071
Python
Python (3.4.3)
py
Runtime Error
17
3064
518
import sys import copy def main(): ABCD = list(map(str, input())) b_digit = len(ABCD)-1 for i in range(2 ** b_digit): signs = ["+"] * b_digit for j in range(b_digit): if ((i >> j ) & 1): signs[b_digit - 1 - j] = "-" ABCD_tmp = copy.deepcopy(ABCD) ...
s292588757
p03545
u489762173
1575673664
Python
Python (3.4.3)
py
Runtime Error
22
3444
535
import sys import copy def main(): ABCD = list(map(str, input())) b_digit = len(ABCD)-1 for i in range(2 ** b_digit): signs = ["+"] * b_digit for j in range(b_digit): if ((i >> j ) & 1): signs[b_digit - 1 - j] ="-" ABCD_tmp = copy.deepcopy(ABCD) ...
s487899740
p03545
u058592821
1575585485
Python
Python (3.4.3)
py
Runtime Error
18
3064
625
S = input() A = int(S[0]) B = int(S[1]) C = int(S[2]) D = int(S[3]) idx = [0, 1, 2] output = [] for i in range(1 << len(idx)): ops = ['+', '+', '+'] if A+B+C+D == 7: print(f'{A}{ops[0]}{B}{ops[1]}{C}{ops[2]}{D}=7') exit() ans = A for j in range(len(idx)): if ((i >> j) & 1)...
s463844359
p03545
u326757732
1575116020
Python
Python (3.4.3)
py
Runtime Error
17
3064
185
A = list(int(input())) for i in range(2**3): tmp=A[:] for j in range(3): if (i>>j)&1: tmp[j]*=-1 if sum(A) == 7: for s in tmp: print(s,end="") print("=7")
s111473849
p03545
u303384315
1574873253
Python
Python (3.4.3)
py
Runtime Error
17
3064
359
s = input() li = [-1,1] a = '+' b = '+' c = '+' for i in li: for j in li: for k in li: if int(s[0])+(i*int(s[1]))+(j*int(s[2]))+(k*int(s[3])) == 7: if i == -1: a = '-' if j == -1: b = '-' if k == -1: c = '-' print(s[0] + a + s[1] + b + s[2] + c + s[3] + '=7') break else: co...
s510073841
p03545
u753386263
1574826290
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38256
306
#1+2+2+2=7 K=input() keta=len(K) #print(K,keta) for i in range(1<<(keta-1)):#探索数 ANS=K[0] for j in range(keta-1):#調査桁数 if (i>>j) &1 == 1:#bitがある、つまりプラスが入る場合 ANS+="+" ANS+=K[j+1] # print(ANS) if eval(ANS)==7: print(ANS+"=7") break
s774515226
p03545
u201565171
1574566365
Python
Python (3.4.3)
py
Runtime Error
17
3064
414
J=list(input()) n=len(J) def dfs_formula(i,f): if i==n-1: return [f] return dfs_formula(i+1,f+"+"+J[i+1])+dfs_formula(i+1,f+"-"+J[i+1]) def dfs_sum(i,f): if i==n-1: return f return str(dfs_sum(i+1,f+int(J[i+1])))+" "+str(dfs_sum(i+1,f-int(J[i+1]))) A=dfs_formula(0,J[0]) S=dfs_sum(...
s747125867
p03545
u607930911
1574319918
Python
Python (3.4.3)
py
Runtime Error
17
2940
48
n = input() for i in range(n): print(bin(n))
s244872185
p03545
u024245528
1574276996
Python
Python (3.4.3)
py
Runtime Error
17
2940
363
from itertools import zip_longest N = input() len_N = len(str(N)) hugo = ["-"]*(len_N-1) for i in range(2**(len_N-1)): hugo = ["-"]*(len_N-1) for j in range(len_N-1): if (i>>j)& 1: hugo[len_N-1-1-j]="+" formula = "" for aaa,bbb in zip_longest(N,hugo+[""]): formula +=(aaa+bbb) if eval(formula)...
s798612417
p03545
u024245528
1574276912
Python
Python (3.4.3)
py
Runtime Error
17
2940
353
from itertools import zip_longest N = input() len_N = len(str(N)) hugo = ["-"]*(len_N-1) for i in range(2**(len_N-1)): hugo = ["-"]*(len_N-1) for j in range(len_N-1): if (i>>j)& 1: hugo[j]="+" formula = "" for aaa,bbb in zip_longest(N,hugo+[""]): formula +=(aaa+bbb) if eval(formula) ==7: ...
s291972227
p03545
u024245528
1574276837
Python
Python (3.4.3)
py
Runtime Error
17
2940
353
from itertools import zip_longest N = input() len_N = len(str(N)) hugo = ["-"]*(len_N-1) for i in range(2**(len_N-1)): hugo = ["-"]*(len_N-1) for j in range(len_N-1): if (i>>j)& 1: hugo[j]="+" formula = "" for aaa,bbb in zip_longest(N,hugo+[""]): formula +=(aaa+bbb) if eval(formula) ==7: ...
s264718476
p03545
u527261492
1573949244
Python
Python (3.4.3)
py
Runtime Error
17
3064
532
s=input() for i in range(4): s[i]=int(s[i]) if s[0]+s[1]+s[2]+s[3]==7: print('s[0]+s[1]+s[2]+s[3]=7') if s[0]+s[1]+s[2]-s[3]==7: print('s[0]+s[1]+s[2]-s[3]=7') if s[0]+s[1]-s[2]+s[3]==7: print('s[0]+s[1]-s[2]+s[3]=7') if s[0]-s[1]+s[2]+s[3]==7: print('s[0]-s[1]+s[2]+s[3]=7') if s[0]-s[1]+s[2]-s[3]==7: pri...
s177798586
p03545
u527261492
1573948000
Python
Python (3.4.3)
py
Runtime Error
18
3064
517
s=list(input()) for i in range(4): s[i]=int(s[i]) if s[0]+s[1]+s[2]+s[3]==7: print(s[0]+s[1]+s[2]+s[3]=7) if s[0]+s[1]+s[2]-s[3]==7: print(s[0]+s[1]+s[2]-s[3]=7) if s[0]+s[1]-s[2]+s[3]==7: print(s[0]+s[1]-s[2]+s[3]=7) if s[0]-s[1]+s[2]+s[3]==7: print(s[0]-s[1]+s[2]+s[3]=7) if s[0]-s[1]+s[2]-s[3]==7: print(...
s924659039
p03545
u527261492
1573947312
Python
Python (3.4.3)
py
Runtime Error
17
3064
519
s=list(input()) for i in s: i=int(i) if s[0]+s[1]+s[2]+s[3]==7: print('s[0]+s[1]+s[2]+s[3]=7') if s[0]+s[1]+s[2]-s[3]==7: print('s[0]+s[1]+s[2]-s[3]=7') if s[0]+s[1]-s[2]+s[3]==7: print('s[0]+s[1]-s[2]+s[3]=7') if s[0]-s[1]+s[2]+s[3]==7: print('s[0]-s[1]+s[2]+s[3]=7') if s[0]-s[1]+s[2]-s[3]==7: print('s[0]...
s794778020
p03545
u602677143
1573782219
Python
Python (3.4.3)
py
Runtime Error
17
3060
258
a,b,c,d = input() ls = ["+","+","+"] p = 0 for i in range(3**2): for j in range(len(ls)): if (i >> n) & 1: ls[j] = "-" if (eval(a+ls[0]+b+ls[1]+c+ls[2]+d)) == 7: print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7") break
s556308189
p03545
u602677143
1573782185
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38256
258
a,b,c,d = input() ls = ["+","+","+"] p = 0 for i in range(3**2): for j in range(len(ls)): if (i >> n) & 1: ls[j] = "-" if (eval(a+ls[0]+b+ls[1]+c+ls[2]+d)) == 7: print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7") break
s871684195
p03545
u992759582
1573372311
Python
Python (3.4.3)
py
Runtime Error
18
3064
380
import sys s = input() a = 7 n = len(s) for i in range(2**(n-1)): total = int(s[0]) ans = [s[0]] for j in range(n-1): if (i >> j) & 1: total += int(s[j+1]) ans.append('+' + s[j+1]) else: total -= int(s[j+1]) ans.append('-'+s[j+1]) if total...
s946945484
p03545
u759412327
1573145179
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
A,B,C,D =input() E ="+-" for i in E: for j in E: for k in E: s=A+i+B+j+C+k+D if eval(s)==7: print(s+"=7") exit()
s685202944
p03545
u759412327
1573145169
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
A,B,C,D =input(); E ="+-" for i in E: for j in E: for k in E: s=A+i+B+j+C+k+D if eval(s)==7: print(s+"=7") exit()
s339993177
p03545
u254871849
1572988226
Python
Python (3.4.3)
py
Runtime Error
18
3188
808
import sys # import collections # import math # import string # import bisect # import re # import itertools # import statistics def main(): a, b, c, d = (int(x) for x in list(sys.stdin.readline().rstrip())) s = 7 - a if sum([b, c, d]) == s: res = '+++' elif sum([-b, c, d]) == s: res = '-++' elif s...
s164674479
p03545
u557494880
1572825614
Python
Python (3.4.3)
py
Runtime Error
17
3060
249
abcd = input() s = 0 i = 0 for i in range(8): a = abcd[0] for j in range(3): if (i >> j) & 1: a += '+' else: a += '-' s = eval(a) if s == 7: ans = a + '=' + '7' break print(ans)
s871098847
p03545
u109617108
1572393587
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38348
411
N=str(input()) a=int(N[0]) b=int(N[1]) c=int(N[2]) d=int(N[3]) for i in range(2): for j in range(2): for k in range(2): t=a if i==0: t+=b else: t-=b if j==0: t+=c else: t-=c if k==0: t+=d else: t-=d ...
s722852066
p03545
u504469481
1572119855
Python
Python (3.4.3)
py
Runtime Error
17
3064
572
def dfs(i, sum): # n 個決め終わったら、今までの和 sum が k と等しいかを返す if i == n - 1: # print(sum) if eval(sum) == k: print(sum+"=7") return eval(sum) == k # + を使う if dfs(i + 1, sum + "-" + s[i+1]): return True # - を使う if dfs(i + 1, sum + "+" + s[i+1]): r...
s058313939
p03545
u504469481
1572119792
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38384
572
def dfs(i, sum): # n 個決め終わったら、今までの和 sum が k と等しいかを返す if i == n - 1: # print(sum) if eval(sum) == k: print(sum+"=7") return eval(sum) == k # + を使う if dfs(i + 1, sum + "-" + s[i+1]): return True # - を使う if dfs(i + 1, sum + "+" + s[i+1]): r...
s992238059
p03545
u712768978
1571516940
Python
Python (3.4.3)
py
Runtime Error
17
2940
609
n = list(map(int,list(input()))) if n[0]+n[1]+n[2]+n[3] == 7: print(f'{n[0]}+{n[1]}+{n[2]}+{n[3]}=7') elif n[0]+n[1]+n[2]-n[3] == 7: print(f'{n[0]}+{n[1]}+{n[2]}-{n[3]}=7') elif n[0]+n[1]-n[2]+n[3] == 7: print(f'{n[0]}+{n[1]}-{n[2]}+{n[3]}=7') elif n[0]+n[1]-n[2]-n[3] == 7: print(f'{n[0]}+{n[1]}-{n[2]}-{n[3]}=7') ...
s803738993
p03545
u383828019
1571513019
Python
Python (3.4.3)
py
Runtime Error
17
3064
462
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") elif a+b+c-d==7: print(a+"+"+b+"+"+c+"-"+d+"=7") elif a+b-c+d==7: print(a+"+"+b+"-"+c+"+"+d+"=7") elif a+b-c-d==7: print(a+"+"+b+"-"+c+"-"+d+"=7") elif a-b+c+d==7: print(a+"-"+b+"+"+c+"+"+d+"=7")...
s496220402
p03545
u383828019
1571512928
Python
Python (3.4.3)
py
Runtime Error
18
2940
454
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") elif a+b+c-d==7: print(a+"+"b+"+"+c+"-"+d+"=7") elif a+b-c+d==7: print(a+"+"b+"-"+c+"+"+d+"=7") elif a+b-c-d==7: print(a+"+"b+"-"+c+"-"+d+"=7") elif a-b+c+d==7: print(a+"-"b+"+"+c+"+"+d+"=7") elif...
s655621466
p03545
u700278227
1571250816
Python
Python (3.4.3)
py
Runtime Error
17
2940
390
s = str(input()) flag = 0 for bit in range(1 << 3): ans = int(s[0]) f = s[0] for i in range(3): if bit & (1 << i): ans += int(s[i+1]) f += "+" else: ans -= int(s[i+1]) f += "-" f += s[i+1] if ans == 7: print(f...
s369623832
p03545
u381246791
1571247878
Python
Python (3.4.3)
py
Runtime Error
18
2940
252
# -*- coding:utf-8 -*- S=input() sign=[+-] for i in range(2): for j in range(2): for n in range(2): if eval(S[0]+sign[i]+S[1]+sign[j]+S[2]+sign[n]+S[3])==7: print(str(S[0]+sign[i]+S[1]+sign[j]+S[2]+sign[n]+S[3])+'=7') exit()
s015464044
p03545
u381246791
1571247002
Python
Python (3.4.3)
py
Runtime Error
18
3064
525
# -*- coding:utf-8 -*- X=list(input()) A,B,C,D=map(int,X) if A+B+C+D==7: print(A+'+'+B+'+'+C+'+'+D+'=7') exit() if A+B+C-D==7: print(A+'+'+B+'+'+C+'-'+D+'=7') exit() if A+B-C+D==7: print(A+'+'+B+'-'+C+'+'+D+'=7') exit() if A-B+C+D==7: print(A+'-'+B+'+'+C+'+'+D+'=7') exit() if A-B-C+D==7: print(A+'-'+B...
s867932971
p03545
u100800700
1570899524
Python
Python (3.4.3)
py
Runtime Error
18
3060
207
a=input() def dfs(i,s,l): if i==3: if s==7: print(l+'=7') else: dfs(i+1,s+int(a[i+1]),l+'+'+a[i+1]) dfs(i+1,s-int(a[i+1]),l+'-'+a[i+1]) dfs(dfs(0,int(a[0]),a[0]))
s187051511
p03545
u524489226
1570651773
Python
Python (3.4.3)
py
Runtime Error
17
3064
371
s = input() n = len(s) - 1 #隙間の数 for i in range(2**3): tmp = s[0] for j in range(n): if (i >> j) & 1: tmp += "+" else: tmp += "-" tmp += s[j+1] list_tmp = [tmp[0], tmp[1:3], tmp[3:5], tmp[5:7]] for j in list_tmp: res += int(j) if res == 7...
s628139812
p03545
u100800700
1570635183
Python
Python (3.4.3)
py
Runtime Error
17
3060
220
def f(i,s,t): if i==3: if s==7: print(t + '=7') exit() else: f(i+1,t+'-'+a[i+1],s-int(a[i+1])) f(i+1,t+'+'+a[i+1],s+int(a[i+1])) a=input() f(0,int(a[0]),a[0])
s952872182
p03545
u100800700
1570635121
Python
Python (3.4.3)
py
Runtime Error
17
3060
220
def f(i,s,t): if i==3: if s==7: print(t + '=7') exit() else: f(i+1,t+'-'+a[i+1],s-int(a[i+1])) f(i+1,t+'+'+a[i+1],s+int(a[i+1])) a=input() f(0,a[0],int(a[0]))
s452493658
p03545
u527261492
1570497156
Python
Python (3.4.3)
py
Runtime Error
17
3064
350
n=input().split() a=int(n[0][0]) b=int(n[0][1]) c=int(n[0][2]) d=int(n[0][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 a...