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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s472324321 | p03545 | u333190709 | 1549838361 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 289 | N = input()
answer = ""
for i in range(1 << 3):
exp = N[0]
for j in range(3):
if i >> j & 1:
exp += "+"
else:
exp += "-"
exp += N[j + 1]
if eval(exp) == 7:
answer = exp
break
print(answer + "=7")
|
s113061404 | p03545 | u333190709 | 1549838229 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 260 | N = input()
for i in range(1 << 3):
exp = N[0]
for j in range(3):
if i >> j & 1:
exp += "+"
else:
exp += "-"
exp += N[j + 1]
if eval(exp) == 7:
print(exp + "=7")
break
|
s000669783 | p03545 | u619819312 | 1548761766 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 269 | s=input()
c=0
l=["+","-"]
for i in range(2):
if c!=0
break
for j in range(2):
if c!=0
break
for p in range(2):
if eval(s[0]+l[i]+s[1]+l[j]+s[2]+l[p]+s[3])==7:
print(s[0]+l[i]+s[1]+l[j]+s[2]+l[p]+s[3]+"=7")
c=1
break |
s785653837 | p03545 | u388927326 | 1548760844 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 299 | #!/usr/bin/env python3
from itertools import product
def main():
a, b, c, d = map(int, input())
for x, y, z in product(("+", "-"), repeat=3):
eq = f"a{x}b{y}c{z}d"
val = eval(eq)
if val == 7:
print(f"{a}{x}{b}{y}{c}{z}{d}=7")
return
main()
|
s009892369 | p03545 | u619819312 | 1548757125 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 199 | s=input()
l=["+","-"]
for i in range(1):
for j in range(i):
for p in range(1):
if eval(s[0]+l[i]+s[1]+l[j]+s[2]+l[p]+s[3])==7:
break
print(s[0]+l[i]+s[1]+l[j]+s[2]+l[p]+s[3]+"=7") |
s542579456 | p03545 | u237362582 | 1548477759 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 636 | package main
import (
"fmt"
"strconv"
)
func main() {
var inputLine string
fmt.Scan(&inputLine)
runeS := []rune(inputLine)
var nums []int
for _, c := range runeS {
n, _ := strconv.Atoi(string(c))
nums = append(nums, n)
}
var temp int
var s string
for i := 0; i < (1 << uint(len(nums)-1)); i++ {
temp ... |
s248633971 | p03545 | u977389981 | 1547225654 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 608 | A = input()
def f(x):
if x % 2 == 0:
return 1
else:
return -1
B = []
for i in range(8):
if int(A[0]) + f(i//4) * int(A[1]) + f(i//2) * int(A[2]) + f(i) * int(A[3]) == 7:
if f(i//4) == 1:
B.append('+')
else:
B.append('-')
if f(i//2) == 1:
... |
s834166118 | p03545 | u785578220 | 1546545355 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1002 | a = input()
x = int(a[0])
y = int(a[1])
z = int(a[2])
w = int(a[3])
o = ["+","-"]
for i in range(2):
for j in range(2):
for k in range(2):
if i == 0 and j == 0 and k == 0:
if x + y + z + w == 7: p = [i,j,k]
elif i == 0 and j == 0 and k == 1:
if x + y ... |
s163473218 | p03545 | u853900545 | 1546186873 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 415 | A = input()
a,b,c,d = A[0],A[1],A[2],A[3]
e1 = a+b+c+d
e2 = a+b+c-d
e3 = a+b-c+d
e4 = a+b-c-d
e5 = a-b+c+d
e6 = a-b+c-d
e7 = a-b-c+d
e8 = a-b+c-d
if eval(e1) == 7:
print(e1)
elif eval(e2) == 7:
print(e2)
elif eval(e3) == 7:
print(e3)
elif eval(e4) == 7:
print(e4)
elif eval(e5) == 7:
print(e5)
elif e... |
s401081699 | p03545 | u887207211 | 1545884356 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 190 | import itertools
A, B, C, D = list(input())
op = ['+','-']
for a,b,c in itertools.product(op,op,op):
x = A + op1 + B + op2 + C + op3 + D
if(eval(x) == 7):
print(x + "=7")
break |
s522947787 | p03545 | u677440371 | 1545169466 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 474 | abcd = str(input())
n = 3
x1 = '+'
x2 = '+'
x3 = '+'
for bits in range(1 << n):
for i in range(n):
if (bits >> i & 1) == 1:
if i == 0:
x1 = '-'
if i == 1:
x2 = '-'
if i == 2:
x3 = '-'
check1 = abcd[0] + x1 + abcd[1] + x2... |
s946180941 | p03545 | u575431498 | 1544758533 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 429 | import sys
def cal(sgn, n1, n2):
return n1 + n2 if sgn == '+' else n1 - n2
A, B, C, D = map(int, list(input()))
sgns = []
for bit in range(1<<3):
tmp = ['+'] * 3
for i in range(3):
if ((bit>>i) & 1) == 1:
tmp[i] = '-'
sgns.append(tmp)
for sgn in sgns:
if cal(sgn[2], cal(sgn[1]... |
s010523550 | p03545 | u575431498 | 1544758417 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 414 | def cal(sgn, n1, n2):
return n1 + n2 if sgn == '+' else n1 - n2
A, B, C, D = map(int, list(input()))
sgns = []
for bit in range(1<<3):
tmp = ['+'] * 3
for i in range(3):
if ((bit>>i) & 1) == 1:
tmp[i] = '-'
sgns.append(tmp)
for sgn in sgns:
if cal(sgn[2], cal(sgn[1], cal(sgn[0... |
s152590782 | p03545 | u778204640 | 1542325535 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 998 | import sys
def check(operate_list, num_list):
res = num_list[0]
for i, op in enumerate(operate_list):
if op == "+":
res += num_list[i+1]
elif op == "-":
res -= num_list[i+1]
return res == 7
def concat(operate_list, num_list):
string = num_list[0]
for op, num... |
s443141564 | p03545 | u778204640 | 1542325388 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 952 | def check(operate_list, num_list):
res = num_list[0]
for i, op in enumerate(operate_list):
if op == "+":
res += num_list[i+1]
elif op == "-":
res -= num_list[i+1]
return res == 7
def concat(operate_list, num_list):
string = num_list[0]
for op, num in zip(oper... |
s722272171 | p03545 | u128914900 | 1542317966 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 901 | def check(in_list,stack):
i = 0
suma = int(in_list[0])
result = in_list[0]
while i < len(stack):
if stack[i] == "-":
suma =suma - int(in_list[i+1])
result = result + "-" + in_list[i+1]
else:
suma += int(in_list[i+1])
result = result + "+" +... |
s433725340 | p03545 | u652150585 | 1541826187 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 295 | import sys
input=sys.stdin.readline
a,b,c,d=map(int,input())
s=[1,-1]
f=['+','-']
for i in range(2):
for j in range(2):
for k in range(2):
if a+b*s[i]+c*s[j]+d*s[k]==7:
print(str(a)+f[i]+str(b)+f[j]+str(c)+f[k]+str(d)+'=7')
exit() |
s702987729 | p03545 | u366133198 | 1541562318 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 683 | #!/usr/bin/python3
import itertools
if __name__=='__main__':
str = input()
signs_comb = list(itertools.combinations_with_rep... |
s966122465 | p03545 | u366133198 | 1541562242 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 676 | #!/usr/bin/python3
import itertools
if __name__=='__main__':
str = input()
signs_comb = list(itertools.combinations_with_rep... |
s625102772 | p03545 | u366133198 | 1541562170 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 669 | #!/usr/bin/python3
import itertools
if __name__=='__main__':
str = input()
signs_comb = list(itertools.combinations_with_rep... |
s821765601 | p03545 | u136869985 | 1540867939 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 243 | A, B, C, D = input()
op = ['+', '-']
for i in op:
tmp = A + i + B
for j in op:
tmp += j + C
for k in op:
tmp += k + D
if eval(tmp) == 7:
print(tmp + '=7')
exit() |
s731231856 | p03545 | u826263061 | 1540674694 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 240 | a, b, c, d = list(map(int, input().split()))
ops = ['+', '-']
for op1 in ops:
for op2 in ops:
for op3 in ops:
s = str(a)+op1+str(b)+op2+str(c)+op3+str(d)
res = eval(s)
if res == 7:
print(s+'=7')
break |
s883889836 | p03545 | u350248178 | 1539576972 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 571 | i=input()
a=int(i[0])
b=int(i[1])
c=int(i[2])
d=int(i[3])
if a+b+c+d==7:
x="+"
y="+"
z="+"
elif a+b+c-d==7:
x="+"
y="+"
z="-"
elif a+b-c+d==7:
x="+"
y="-"
z="+"
elif a-b+c+d==7:
x="-"
y="+"
z="+"
elif a-b-c+d==7:
x="-"
y="-"
z="+"
elif a-b+c-d==7:
x=... |
s923305003 | p03545 | u350248178 | 1539576596 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 581 | i=input()
a=int(i[0])
b=int(i[1])
c=int(i[2])
d=int(i[3])
if a+b+c+d==7:
x="+"
y="+"
z="+"
if a+b+c-d==7:
x="+"
y="+"
z="-"
if a+b-c+d==7:
x="+"
y="-"
z="+"
if a-b+c+d==7:
x="-"
y="+"
z="+"
if a-b-c+d==7:
x="-"
y="-"
z="+"
if a-b+c-d==7... |
s296372749 | p03545 | u319899784 | 1539013734 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 314 | S = input()
n = len(S)
for i in range(1 << (n - 1)):
eq = ''
for j in range(n - 1):
eq += S[j]
if (i >> j) & 1 :
eq += '+'
else:
eq += '-'
eq += S[n-1]
ans = eval(eq)
if(ans == 7):
print(eq + '=' + str(ans))
break |
s723768906 | p03545 | u319899784 | 1539013483 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 300 | S = input()
n = len(S)
for i in range(1 << (n - 1)):
eq = ''
for j in range(n - 1):
eq += S[j]
if (i >> j) & 1 :
eq += '+'
else:
eq += '-'
eq += S[n-1]
ans = eval(eq)
if(ans == 7):
print(eq + '=' + str(ans))
|
s527200396 | p03545 | u519078363 | 1538951663 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 255 | [n, Y] = list(map(int, input().split()))
x, y, z = -1, -1, -1
for xx in range(n+1):
for yy in range(n+1-xx):
zz = n - xx - yy
if Y == 10000 * xx + 5000 * yy + 1000 * zz:
x, y, z = xx, yy, zz
break
print(x, y, z) |
s427522708 | p03545 | u685263709 | 1536886812 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 688 | use std::io::*;
use std::str::FromStr;
fn read<T: FromStr>() -> T {
let stdin = stdin();
let stdin = stdin.lock();
let token: String = stdin
.bytes()
.map(|c| c.expect("failed to read char") as char)
.skip_while(|c| c.is_whitespace())
.take_while(|c| !c.is_whitespace())
... |
s768078347 | p03545 | u232852711 | 1536724633 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 418 | a, b, c, d = list(map(int, list(input())))
ops = {'+', '-'}
for op1 in ops:
if op1 == '+': ab = a+b
else: ab = a-b
for op2 in ops:
if op2 == '+': abc = ab+c
else: abc = ab-c
for op3 in ops:
if op3 == '+': abcd = abc+d
else: abcd = abc-d
... |
s261557539 | p03545 | u474270503 | 1535480401 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 426 | ABCD=list(map(int, list(input())))
for i in range(1<<3):
tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
a=ABCD[0]
for j in range(3):
if tmp[j]:
a+=ABCD[j+1]
else:
a-=ABCD[j+1]
if a==7:
print(ABCD[0], end="")
for j in range(3):
print... |
s800777200 | p03545 | u474270503 | 1535480362 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 441 | ABCD=list(map(int, list(input())))
for i in range(1<<3):
tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
print(tmp)
a=ABCD[0]
for j in range(3):
if tmp[j]:
a+=ABCD[j+1]
else:
a-=ABCD[j+1]
if a==7:
print(ABCD[0], end="")
for j in range(3):
... |
s112503718 | p03545 | u677440371 | 1535406262 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1627 | {
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"8 5\n"
]
}
],
"source": [
"n,k = map(int,input().split())"
]
},
{
"cell_type": "code",
"execution_count"... |
s147801997 | p03545 | u496344397 | 1534631341 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 245 | from itertools import product
A, B, C, D = list(map(int, input()))
for pattern in product('+-', repeat=3):
f = '{}{}{}{}{}{}{}'.format(A, pattern[0], B, pattern[1], C, pattern[2], D) if eval(f) == 7:
print(f+'=7')
break |
s703542329 | p03545 | u856232850 | 1530731163 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 266 | n = input()
a = ['+','-']
b = ''
ans = ''
for i in a:
b += n[0]+i
for j in a:
b += n[1]+j
for k in a:
b += n[2]+k+n[3]
if eval(b) == 7:
ans = b+'=7'
else:
b = ''
print(ans) |
s079809305 | p03545 | u669770658 | 1530208323 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 624 | A, B, C, D = map(int, input().split())
a = "%d+%d+%d+%d=7" % (A, B, C, D)
b = "%d+%d+%d-%d=7" % (A, B, C, D)
c = "%d+%d-%d+%d=7" % (A, B, C, D)
d = "%d-%d+%d+%d=7" % (A, B, C, D)
e = "%d+%d+%d+%d=7" % (A, B, C, D)
f = "%d-%d+%d-%d=7" % (A, B, C, D)
g = "%d-%d-%d+%d=7" % (A, B, C, D)
h = "%d-%d-%d-%d=7" % (A, B, C, D)
... |
s810871058 | p03545 | u140251125 | 1528308014 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 1132 | # input
N = int(input())
L = [int(x) for x in list(str(N))]
ans = 0
if L[0] + L[1] + L[2] + L[3] == 7:
print("%d+%d+%d+%d=7" % (L[0], L[1], L[2], L[3]))
else:
if L[0] - L[1] + L[2] + L[3] == 7:
print("%d-%d+%d+%d=7" % (L[0], L[1], L[2], L[3]))
else:
if L[0] + L[1] - L[2] + L[3] == 7:
... |
s393989431 | p03545 | u829895669 | 1527740302 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 412 | ABCD = list(map(int, input().split()))
for i in range(1 << 3):
total = ABCD[0]
equation = str(ABCD[0])
for j in range(3):
if i & (1 << j):
total += ABCD[j+1]
equation += "+"
else:
total -= ABCD[j+1]
equation += "-"
equation += str(... |
s734074400 | p03545 | u829895669 | 1527740052 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 427 | ABCD = list(map(int, input().split()))
for i in range(1 << 3):
total = ABCD[0]
equation = str(ABCD[0])
for j in range(3):
if i & (1 << j):
total += ABCD[j+1]
equation.append("+")
else:
total -= ABCD[j+1]
equation.append("-")
equati... |
s378727131 | p03545 | u043434786 | 1525226957 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 664 | l=[int(x) for x in list(input())]
if l[0]+l[1]+l[2]+l[3]==7: print('{}+{}+{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]+l[2]-l[3]==7: print('{}+{}+{}-{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]-l[2]+l[3]==7: print('{}+{}-{}+{}=7'.format(l[0],l[1],l[2],l[3])
elif l[0]+l[1]-l[2]-l[3]==7: print('{}+{}-{}-{}=7'.... |
s083721648 | p03545 | u503901534 | 1524203995 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 571 | p = int(input())
q =list(str(p))
r = []
for i in range(len(q)):
r.append(int(q[i]))
a = r[0]
b = [-r[1],r[1]]
c = [-r[2],r[2]]
d = [-r[3],r[3]]
e = []
for i in range(2):
for j in range(2):
for k in range(2):
if a + b[i] + c[j] + d[k] == 7:
e.append(a)
e... |
s103011389 | p03545 | u729707098 | 1521405119 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 308 | import itertools
n = input()
x, pm, a = [], [1,-1], 7-int(n[0])
for i in range(1,4):
x.append(int(n[i]))
for j in itertools.product(pm,repeat=3):
if x[0]*j[0]+x[1]*j[1]+x[2]*j[2]==a:
y = j
break
for k in range(3):
if y[k]==1: y[k] = "+"
else: y[k] = "-"
print(n[0]+y[0]+n[1]+y[1]+n[2]+y[2]+n[3]+"=7") |
s279949319 | p03545 | u915214301 | 1520258210 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 697 | nums = [int(num) for num in input()]
target = 7
if sum(nums) == target:
symbols = '+++'
elif nums[0] + nums[1] + nums[2] - nums[3] == target:
symbols = '++-'
elif nums[0] + nums[1] - nums[2] + nums[3] == target:
symbols = '+-+'
elif nums[0] + nums[1] - nums[2] - nums[3] == target:
symbols = '+--'
elif... |
s360854200 | p03545 | u143492911 | 1517520178 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 676 | ans=list(input())
a=int(ans[0])
b=int(ans[1])
c=int(ans[2])
d=int(ans[3])
pass=int(ans[3])
if b+c+d+e==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-... |
s748556985 | p03545 | u483722302 | 1516498113 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 504 | # -*- coding: utf-8 -*-
A,B,C,D = list(map(int, list(input())))
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+... |
s402659245 | p03545 | u483722302 | 1516497823 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 402 | # -*- coding: utf-8 -*-
A,B,C,D = list(map(int, input().split()))
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 A-B+C-D == 7:
print('A-B+C-D=7')
eli... |
s216918475 | p03545 | u789417951 | 1514519244 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 385 | H, W=map(int,input().split(' '))
c=[list(map(int,input().split(' '))) for i in range(10)]
a=[list(map(int,input().split(' '))) for i in range(H)]
ans=0
for i in range(10):
for j in range(10):
for k in range(10):
c[i][j]=min(c[i][j],c[i][k]+c[k][j])
for i in range(H):
for j in range(W):
... |
s842539185 | p03545 | u692632484 | 1514186251 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1256 | #include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include <map>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include"time.h"
using namespace std;
#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR(... |
s031860249 | p03545 | u558836062 | 1512803623 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 302 | a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(2): # 1つ目の記号
for j in range(2): # 2つ目の記号
for k in range(2): # 3つ目の記号
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") |
s626049311 | p03545 | u558836062 | 1512803506 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 302 | a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(2): # 1つ目の記号
for j in range(2): # 2つ目の記号
for k in range(2): # 3つ目の記号
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") |
s196427105 | p03545 | u558836062 | 1512803449 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 302 | a, b, c, d = map(str,input().split())
sign = "+-"
for i in range(3): # 1つ目の記号
for j in range(3): # 2つ目の記号
for k in range(3): # 3つ目の記号
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") |
s893124025 | p03545 | u558836062 | 1512803375 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 303 | a, b, c, d = map(str,input().split())
sign = "+-*"
for i in range(3): # 1つ目の記号
for j in range(3): # 2つ目の記号
for k in range(3): # 3つ目の記号
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") |
s454377313 | p03545 | u048904090 | 1512267031 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2692 | 505 | A, B, C, D = map(int, raw_input().split())
if A+B+C+D == 7:
print '%s+%s+%s+%s' % (A, B, C, D)
elif A+B+C-D == 7:
print '%s+%s+%s-%s' % (A, B, C, D)
elif A+B-C+D == 7:
print '%s+%s-%s+%s' % (A, B, C, D)
elif A-B+C+D == 7:
print '%s-%s+%s+%s' % (A, B, C, D)
elif A+B-C-D == 7:
print '%s+%s-%s-%s' % (... |
s307364662 | p03545 | u017612119 | 1512192314 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 410 | a,b,c,d = map(int,input())
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 a-b-c+d == 7:
... |
s941879917 | p03545 | u136553578 | 1512092853 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 612 | ns = [int(n) for n in input()]
for i in range(0b000, 0b111 + 1):
s = ns[0]
if (i & 0b100) != 0:
s += ns[1]
else:
s -= ns[1]
if (i & 0b010) != 0:
s += ns[2]
else:
s -= ns[2]
if (i & 0b001) != 0:
s += ns[3]
else:
s -= ns[3]
if s == 7:
... |
s738430757 | p03545 | u022674544 | 1512010590 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 587 | 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('{}+{}+{}+{}=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,... |
s987524468 | p03545 | u019584841 | 1511403256 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 167 | n=input()
pm=[+,-]
for op1 in pm:
for op2 in pm:
for op3 in pm:
if (n[0] op1 n[1] op2 n[2] op3 n[3])==7:
print("n[0] op1 n[1] op2 n[2] op3 n[3]=7") |
s890221466 | p03545 | u019584841 | 1511402445 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 72 | n=int(input())
a = n[0] +or- n[1] +or- n[2] +or-n[3]
if a==7:
print(a) |
s250674513 | p03545 | u122873963 | 1511305941 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 498 | a = [int(i) for i in list(input())]
enzan = ['+', '+', '+']
res = 0
for i in range(2):
if i == 0:
enzan[0] = '+'
b = a[0] + a[1]
else:
enzan[0] = '-'
b = a[0] - a[1]
for j in range(2):
if j == 0:
enzan[1] = '+'
c = b + a[2]
else:
enzan[1] = '-'
c = b - a[2]
for k in range(2):
if k == 0:
... |
s349884624 | p03545 | u126747509 | 1511287573 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 602 | def main():
a, b, c, d = map(int, input().split())
num_list = [a, b, c, d]
if (a-b-c-d == 7): print('{}-{}-{}-{}=7'.format(*num_list))
elif (a-b-c+d == 7): print('{}-{}-{}+{}=7'.format(*num_list))
elif (a-b+c-d == 7): print('{}-{}+{}-{}=7'.format(*num_list))
elif (a+b-c-d == 7): print('{}+{}-{}-... |
s119084456 | p03545 | u126747509 | 1511287395 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 601 | def main():
a, b, c, d = map(int, input().split())
num_list = [a, b, c, d]
if (a-b-c-d == 7): print('{}-{}-{}-{}=7'.format(*num_list))
elif (a-b-c+d == 7): print('{}-{}-{}+{}=7'.format(*num_list))
elif (a-b+c-d == 7): print('{}-{}+{}-{}=7'.format(*num_list))
elif (a+b-c-d == 7): print('{}+{}{}-{... |
s747963421 | p03545 | u126747509 | 1511287027 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 818 | def solve(a, b, c, d):
op_list = ['+', '-']
sumv = a
for op1 in op_list:
if op1 == '+':
sumv += b
else:
sumv -= b
for op2 in op_list:
if op2 == '+':
sumv += c
else:
sumv -= c
for op3 in op_lis... |
s465697546 | p03545 | u126747509 | 1511286860 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 825 | def solve(a, b, c, d):
op_list = ['+', '-']
sumv = a
for op1 in op_list:
if op1 == '+':
sumv += b
else:
sumv -= b
for op2 in op_list:
if op2 == '+':
sumv += c
else:
sumv -= c
for op3 in op_lis... |
s363525767 | p03545 | u017612119 | 1511062775 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 355 | a,b,c,d = map(int,input())
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 a-b-c+d == 7:
... |
s515450027 | p03545 | u781152930 | 1511062435 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 406 | # -*- coding: utf-8 -*-
A, B, C, D = map(int, input().split())
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 A-B+C-D == 7:
print("A-B+C-D =7")
... |
s199629279 | p03545 | u558836062 | 1511061603 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 575 | 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('{0}+{1}+{2}+{3}=7' .format(a,b,c,d))
if a-b+c+d == 7:
print('{0}-{1}+{2}+{3}=7' .format(a,b,c,d))
if a+b-c+d == 7:
print('{0}+{1}-{2}+{3}=7' .format(a,b,c,d))
if a+b+c-d == 7:
print('{0}+{1}+{2—{3}=7' .format(a,b,c,d))
... |
s658774028 | p03545 | u558836062 | 1511061496 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 | 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('{0}+{1}+{2}+{3}=7' .format(a,b,c,d))
if a-b+c+d == 7:
print('{0}-{1}+{2}+{3}=7' .format(a,b,c,d))
if a+b-c+d == 7:
print('{0}+{1}-{2}+{3}=7' .format(a,b,c,d))
if a+b+c-d == 7:
print('{0}+{1}+{2—{3}=7' .format(a,b,c,d))
... |
s533491779 | p03545 | u456877307 | 1511061089 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2696 | 1017 | N = raw_input()
keys = ['+','-']
x = 0
check = True
for key1 in keys:
if key1 == '+' and check:
x = int(N[0]) + int(N[1])
elif(key1 == '-' and check):
x = int(N[0]) - int(N[1])
for key2 in keys:
if key2 == '+' and check:
x = x + int(N[2])
elif(key2 == '-' and ch... |
s160277968 | p03545 | u839857256 | 1511060745 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3188 | 1091 | num = list(map(int, input().split()))
if sum(num) == 7:
print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] + num[1] + num[2] - num[3] == 7:
print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] + num[1] - num[2] - num[3] ... |
s967470427 | p03545 | u667024514 | 1511060424 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 446 | r = int(input())
a = r[0]
b = r[1]
c = r[2]
d = r[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 a-b+c-d =... |
s238540455 | p03545 | u667024514 | 1511060334 | Python | Python (3.4.3) | py | Runtime Error | 22 | 2940 | 458 | r = int(input())
a = r[0]
b = r[1]
c = r[2]
d = r[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 a-b+c-d =... |
s303918919 | p03545 | u479113369 | 1511059516 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 460 | sr = input()
a, b, c, d = int(sr[0]), int(sr[1]), int(sr[2]), int(sr[3])
def calc(one, two, three):
if a + b*one + c*two + d*three == 7:
return True
else:
return False
def change(num):
if num == 1:
return "+"
else:
return "-"
for q in [1, -1]:
for w in [1, -1]:
for e in [1, -1]:
... |
s709214894 | p03545 | u444856278 | 1511058763 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 260 | s = str
End = False
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
for j in [C,-1*C]:
for k in [D,-1*D]:
if A + i + j + k == 7:
print(f"{A:d}{i:+d}{j:+d}{k:+d}=7")
exit() |
s379350491 | p03545 | u448407332 | 1511058373 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 634 | n = int(input())
a = n // 1000
b = n % 1000 // 100
c = n % 100 // 10
d = n % 10
def calc(ind, x):
if ind == 0:
return x
else:
return -x
flag = 0
for j in range(2):
ans = a
if flag:
break
ans += calc(j, b)
for k in range(2):
if flag:
break
ans... |
s087189471 | p03545 | u444856278 | 1511058150 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 347 | s = str
End = False
S = input()
A,B,C,D = int(S[0]),int(S[1]),int(S[2]),int(S[3])
for i in [B,-1*B]:
for j in [C,-1*C]:
for k in [D,-1*D]:
if A + i + j + k == 7:
print(f"{A:d}{i:+d}{j:+d}{k:+d}=7")
End = True
break
if End:
break... |
s395734223 | p03545 | u331159771 | 1511057860 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 746 | def check_if_seven(num_list):
if sum(num_list) == 7:
return "+,+,+"
elif num_list[0] - sum(num_list[1:]) == 7:
return "-,+,+"
elif num_list[0] + num_list[1] - sum(num_list[2:]) == 7:
return "+,-,+"
elif sum(num_list[:-1]) - num_list[-1] == 7:
return "+,+,-"
elif num_l... |
s572002764 | p03545 | u247904511 | 1511057124 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 231 | s = input()
ops = ['-', '+']
for i in range(2):
for j in range(2):
for k in range(2):
com = s[0] + op[i] + s[1] + op[j] + s[2] + op[k] + s[3]
if eval(com) == 7:
print(com + '=7')
|
s139403668 | p03546 | u248670337 | 1600281244 | Python | Python (3.8.2) | py | Runtime Error | 322 | 53160 | 349 | from networkx import *
h,w=map(int,input().split());r=range(10);G=DiGraph();G.add_nodes_from(r);C=[[*map(int,input().split())]for _ in "_"*10];G.add_weighted_edges_from([(i,j,C[i][j])for i in r for j in r]);S=[single_source_dijkstra_path_length(G,i)[1]for i in r];A=[[*map(int,input().split())]for _ in r];print(sum(S[ab... |
s846444655 | p03546 | u261103969 | 1592963542 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74816 | 735 | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
from collections import Counter
import networkx as nx
h, w = map(int, readline().split())
G = nx.DiGraph()
for i in range(10):
costs = list(map(int, readline().split()... |
s052311206 | p03546 | u026155812 | 1592502081 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 389 | H, W = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
A = [list(map(int, input().split())) for _ in range(H)]
for k in range(10):
for i in range(10):
for j in range(10):
c[i][j] = min(c[i][j], c[i][k] + c[k][j])
ans = 0
for h in range(H):
for w in range(... |
s362135622 | p03546 | u627803856 | 1591704395 | Python | PyPy3 (2.4.0) | py | Runtime Error | 194 | 40180 | 522 | H, W = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
A = [list(map(int, input().split())) for _ in range(H)]
# 0,(1),2,3,...,9に対して1にするための最小コストを求める
INF = 10 ** 4
d = c.copy()
for k in range(10):
for i in range(10):
for j in range(10):
d[i][j] = min(d[i][j], ... |
s143856189 | p03546 | u968166680 | 1591593753 | Python | Python (3.4.3) | py | Runtime Error | 25 | 5924 | 648 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
def main():
H, W = map(int, readline().split())
C = [list(map(int, readline().split())) for _ in range(10)]
A = list(map(int, read().split()))
counter = Counter... |
s479867096 | p03546 | u860002137 | 1591459637 | Python | Python (3.4.3) | py | Runtime Error | 159 | 13072 | 647 | from collections import deque
import numpy as np
h, w = map(int, input().split())
dp = [list(map(int, input().split())) for _ in range(10)]
arr = np.array([list(map(int, input().split())) for h in range(h)])
# ワーシャルフロイド法で更新がなくなるまで更新
while True:
prev = copy.deepcopy(dp)
for k in range(10):
for i in ran... |
s624843585 | p03546 | u991134049 | 1590858532 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38768 | 469 | H, W= map(int, input().split())
minpath = [[float("inf")]*10 for _ in range(10)]
path = [list(map(int, input().split())) for i in range(10)]
for i in range(10):
for j in range(10):
for k in range(10):
minpath[j][k] = min(minpath[j][k], path[j][i]+path[i][k])
ans = 0
for i in range(H):
A = li... |
s299776023 | p03546 | u025287757 | 1590806246 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 233 | 3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 4 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5 6 |
s838068189 | p03546 | u018771977 | 1590790134 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 632 | #! env/bin/local python3
# -*- coding: utf-8 -*-
import numpy as np
inputs: list = []
while True:
try:
inputs.append([int(i) for i in input().split()])
except EOFError:
break
h, w = inputs[0]
c = inputs[1: 11]
a = inputs[11:]
number_of_edge = 10
number_of_node = 10
for k in range(number_of... |
s366399689 | p03546 | u043048943 | 1590667491 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 1098 | def main():
from sys import setrecursionlimit, stdin
from os import environ
from collections import defaultdict, deque, Counter
from math import ceil, floor, gcd
from itertools import accumulate, combinations, combinations_with_replacement
setrecursionlimit(10**6)
dbg = (lambda *something: p... |
s627299345 | p03546 | u797550216 | 1590012157 | Python | Python (3.4.3) | py | Runtime Error | 181 | 14436 | 707 | import numpy as np
import itertools
import collections
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
H,W = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
A = [list(map(int,input().split())) for i in... |
s373585086 | p03546 | u477320129 | 1589688536 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 1090 | #!/usr/bin/env python3
import sys
def solve(H: int, W: int, c: "List[List[int]]", A: "List[List[int]]"):
#print(*c, sep='\n')
for k in range(10):
for i in range(10):
for j in range(10):
c[i][j] = min(c[i][j], c[i][k]+c[k][j])
#print(*c, sep='\n')
cost = 0
for a ... |
s274290444 | p03546 | u477320129 | 1589688495 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 1090 | #!/usr/bin/env python3
import sys
def solve(H: int, W: int, c: "List[List[int]]", A: "List[List[int]]"):
#print(*c, sep='\n')
for k in range(10):
for i in range(10):
for j in range(10):
c[i][j] = min(c[i][j], c[i][k]+c[k][j])
#print(*c, sep='\n')
cost = 0
for a ... |
s770849406 | p03546 | u025501820 | 1589516264 | Python | PyPy3 (2.4.0) | py | Runtime Error | 200 | 40172 | 792 | #!/usr/bin/env python3
H, W = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
grid = [list(map(int, input().split())) for _ in range(H)]
d = dict()
nums = [i for i in range(10) if i != 1]
q = [[[1], 0]]
while q:
tmp = q.pop()
num, cost = tmp[0], tmp[1]
key = str(num[-1... |
s152550545 | p03546 | u025501820 | 1589515991 | Python | PyPy3 (2.4.0) | py | Runtime Error | 196 | 40924 | 846 | #!/usr/bin/env python3
from collections import defaultdict, deque
H, W = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
grid = [list(map(int, input().split())) for _ in range(H)]
d = defaultdict(lambda: float("inf"))
d["1_1"] = 0
nums = [i for i in range(10) if i != 1]
q = deque([... |
s454712597 | p03546 | u426764965 | 1589513554 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 920 | def abc079_d():
inp = iter(map(int, read().split()))
H, W = next(inp), next(inp)
adj_mtx = [[next(inp) for _ in range(10)] for _ in range(10)]
grid = [[next(inp) for _ in range(W)] for _ in range(H)]
def floyd_warshall(W):
''' ワーシャルフロイド法、全頂点間の最短距離 '''
n = len(W) # 頂点の数
# DP... |
s559361655 | p03546 | u426764965 | 1589512158 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 2162 | def abc079_d():
inp = iter(map(int, read().split()))
H, W = next(inp), next(inp)
adj_mtx = [[next(inp) for _ in range(10)] for _ in range(10)]
grid = [[next(inp) for _ in range(W)] for _ in range(H)]
import heapq
def dijkstra(start, W):
''' スタート地点から到達可能なすべての頂点への最短距離を返す
Pytho... |
s013232005 | p03546 | u623819879 | 1589247568 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 456 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
graph=[]
h,w=map(int,input().split())
for i in range(10):
graph.append(list(map(int,input().split())))
graph = csr_matrix(graph)
d, p = floyd_warshall(csgraph=graph, directed=True, return_predecessors=True)
#print(d)
dic={-1:0}
for... |
s925627161 | p03546 | u588794534 | 1588953265 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38256 | 233 | 3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 4 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5 6 |
s817290202 | p03546 | u867848444 | 1588710951 | Python | PyPy3 (2.4.0) | py | Runtime Error | 203 | 40172 | 505 | h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]
'''重み0の辺は自動で消されてしまうので注意'''
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
inf = 10 ** 10
G = csgraph_from_dense(c, null_value = 0)
d = floyd_warshall(G)
co... |
s023949774 | p03546 | u867848444 | 1588710445 | Python | Python (3.4.3) | py | Runtime Error | 249 | 18004 | 512 | h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]
'''重み0の辺は自動で消されてしまうので注意'''
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
inf = 10 ** 10
G = csgraph_from_dense(c, null_value = 10 ** 10)
d = floyd_warshal... |
s756714341 | p03546 | u260216890 | 1588216872 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38384 | 588 | from itertools import permutations
h,w=map(int,input().split())
d=[list(map(int,input().split())) for i in range(10)]
def warshall_floyd(d):
for k in range(n):
for i in range(n):
for j in range(n):
d[i][j] = min(d[i][j],d[i][k] + d[k][j])
return d
d=warshall_floyd(d)
cost=[d... |
s964908170 | p03546 | u992910889 | 1588128310 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38256 | 757 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()
def resolve():
H, W = map(int, input().split())
graph = [[i for i in list(map(int, input().split()))] for _ in range(10)]
... |
s173910888 | p03546 | u992910889 | 1588128273 | Python | PyPy3 (2.4.0) | py | Runtime Error | 199 | 39920 | 677 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()
H, W = map(int, input().split())
graph = [[i for i in list(map(int, input().split()))] for _ in range(10)]
graph = csr_matrix(graph)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.