problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03011
u863370423
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['d12=int(input())\nd13=int(input())\nd23=int(input())\ndt1=d12+d23\ndt2=d23+d13\ndt3=d13+d12\nif (dt1<dt2 and dt1<dt3):\n print(dt1)\nelif (dt2<dt1 and dt2<dt3):\n print(dt2)\nelse:\n print(dt3)', 'datos=input().split()\nd12=int(datos[0])\nd13=int(datos[1])\nd23=int(datos[2])\n\ndm=d12+d23\ndm1=d13+d12\ndm2=d...
['Runtime Error', 'Accepted']
['s278279329', 's622914243']
[9060.0, 8912.0]
[28.0, 28.0]
[191, 271]
p03011
u864650257
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['A,B,C =map(int,input().split())\nprint(max(A+B,A+C,B+C))\n\n\n', '1. A,B,C =map(int,input().split())\n2. print(max(A+B,A+C,B+C))', 'A,B,C =map(int,input().split())\nprint(min(A+B,A+C,B+C))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s018363071', 's257283467', 's348077535']
[3060.0, 2940.0, 2940.0]
[20.0, 19.0, 17.0]
[58, 61, 55]
p03011
u867320886
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['import numpy as np', 'import numpy as np\np,q,r = map(int,input().split())\nprint(p+q+r-np.max([p,q,r]))']
['Wrong Answer', 'Accepted']
['s026724418', 's901446519']
[12428.0, 21652.0]
[149.0, 319.0]
[18, 80]
p03011
u873839198
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a = list(map(int, input().split()))\n\nprint(min(a[0]+ a[1], a[1] + a[2], a[2]+ a[0])', 'a = list(map(int, input().split()))\n \nprint(min(a[0]+ a[1], a[1] + a[2], a[2]+ a[0]))']
['Runtime Error', 'Accepted']
['s909750483', 's905602222']
[2940.0, 2940.0]
[17.0, 17.0]
[83, 85]
p03011
u877428733
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['P = int(input())\nQ = int(input())\nR = int(input())\n\nlist = []\n\nlist = P,Q,R\nnewlist = sorted(list)\n\na = newlist[0] + newlist[1]\nprint(a)\n\n\n', 'N = int(input())\nW = map(int, input().split())\ns1, s2 = 0, sum(W)\nans = sum(W)\nfor i in range(N):\n\ts1 += W[i]\n\ts2 -= W[i]\n\tans = min(ans, abs(s1 - s2))\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s133912833', 's899780830', 's251216211']
[2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[139, 162, 100]
p03011
u883850005
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a=int(input())\nb=int(input())\nc=int(input())\n\nif (a>=b)&&(b>=c):\n ans=a+b\n print("",ans)\nelif (b>=a)&&(c>=a):\n ans=b+c\n print("",ans)\nelse (a>=c)&&(c>=b):\n ans=a+c\n print("",ans)', 'num=list(map(int, input().split()))\nnum=sorted(num)\nans=num[0]+num[1]\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s895742501', 's201469012']
[2940.0, 2940.0]
[17.0, 17.0]
[184, 81]
p03011
u888260709
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['print(min([sum(l) - l[i] for i in range(len(list(map(int, input().split()))))]))', 'inp = [int(s) for s in input().split()]\n\nans = sum(inp) - max(inp)\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s427598982', 's539234323']
[2940.0, 2940.0]
[17.0, 17.0]
[80, 78]
p03011
u889344512
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p,q,r = map(int,input().split())\nprint(min(min(p+q,q+r),r+p)))', 'p,q,r = map(int,input().split)\nprint(min(p+q,q+r,r+p))', 'p,q,r = map(int,input().split())\nprint(min(p+q,q+r,r+p))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s018584867', 's758010801', 's670486844']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[62, 54, 56]
p03011
u893584578
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['#coding: utf-8\n\nline = input()\nfor i in range(3):\n\tarr.append(int(line.split()[i]))\nans = sum(arr) - max(arr)\nprint(ans)\n\n', "#coding: utf-8\ndef factorial(n):\n\toutput = 1\n\tfor i in range(1,n+1):\n\t\toutput = output*i\n\treturn output\n\ndef diff(w, sign, N):\n\tdiff = 0\n\tfor i in range(N):\n\t\tdiff ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s188781771', 's813731337', 's612152579']
[2940.0, 3064.0, 2940.0]
[18.0, 18.0, 17.0]
[122, 770, 129]
p03011
u895526251
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['MOD = (10**9 + 7)\nbroken_step = []\n \nline = [int(s) for s in input().split()]\n \nN, M = line[0], line[1]\n \nfor i in range(M):\n step_num = int(input().split()[0])\n broken_step.append(step_num)\n \n \ndp = [0]*(N+1)\ndp[0] = 1\nif 1 in broken_step:\n dp[1] = 0\nelse:\n dp[1...
['Runtime Error', 'Accepted']
['s538694155', 's306086880']
[3064.0, 2940.0]
[17.0, 24.0]
[414, 59]
p03011
u896726004
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p, q, r = list(map(int, input().split()))\nlist_ = sorted(list_)\n\nprint(list_[0]+list_[1])', 'list_ = sorted(list(map(int, input().split())))\nprint(list_[0]+list_[1])']
['Runtime Error', 'Accepted']
['s515523346', 's846549106']
[2940.0, 2940.0]
[17.0, 17.0]
[89, 72]
p03011
u896741788
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['s=list(map(int,input().split()))\nprint(sum(l)-max(l))', 'l=list(map(int,input().split()))\nprint(sum(l)-max(l))']
['Runtime Error', 'Accepted']
['s733602817', 's052522215']
[2940.0, 2940.0]
[18.0, 17.0]
[53, 53]
p03011
u897895794
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
["import numpy as np\nfrom pprint import pprint\n\n\ndef solve(MM, H, W):\n\n L, R, U, D = np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int)\n\n for i in range(H):\n i_r = H - 1 - i\n\n # L, U\n for j in range(W):\n j...
['Runtime Error', 'Accepted']
['s848738538', 's424439365']
[12528.0, 2940.0]
[152.0, 17.0]
[1836, 129]
p03011
u898080410
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p, q, r = map(int, input().split())\nsorted_list = sorted(list[p, q, r])\nans = sorted_list[0] + sorted_list[1]\nprint(ans)\n', 'p, q, r = map(int, input().split())\nsorted_list = sorted([p, q, r])\nans = sorted_list[0] + sorted_list[1]\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s382927375', 's801665102']
[3064.0, 2940.0]
[18.0, 17.0]
[121, 117]
p03011
u898690911
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['print', 'import numpy', 'import numpy as np', 'import numpy', 'test', 'import numpy', 'text', 'p, q, r = map(int, input().split())\n \nm = 10e9\n \nm = min(m, p + q)\nm = min(m, r + q)\nm = min(m, p + r)\n \nprint(m)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s035279766', 's253549710', 's293137056', 's332018947', 's504463118', 's588020634', 's652961535', 's554866221']
[2940.0, 12488.0, 12428.0, 12488.0, 2940.0, 12488.0, 2940.0, 2940.0]
[17.0, 150.0, 148.0, 150.0, 17.0, 148.0, 17.0, 17.0]
[5, 12, 18, 12, 4, 12, 4, 113]
p03011
u898999125
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p, q, r = map(int, input().split())\n\ntotal = soated(p, q, r)\n\nprint(total[0]+total[1])', 'time = list(map(int, input().split()))\n\nt = soated(time)\n\nprint(t[0]+t[1])', 'time = list(map(int, input().split()))\n\nt = sorted(time)\n\nprint(t[0]+t[1])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s255852890', 's258722737', 's545324588']
[2940.0, 3064.0, 2940.0]
[17.0, 17.0, 17.0]
[86, 74, 74]
p03011
u903629757
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p,q,r = map(int,input().split())\nprint(p + q + r)', 'p,q,r, = map(int,input().split())\nprint(min(p+q,p+r,r+q))']
['Wrong Answer', 'Accepted']
['s173314046', 's633633520']
[9064.0, 9160.0]
[28.0, 28.0]
[49, 57]
p03011
u904995051
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['#ABC129\np,q,r = map(int,input().split())\nprint(min(p+r,r+q))', '#ABC129\np,q,r = map(int,input().split())\nprint(min(p+r,r+q,p+q))']
['Wrong Answer', 'Accepted']
['s431782254', 's315979886']
[8904.0, 9052.0]
[24.0, 27.0]
[60, 64]
p03011
u905582793
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N = input()\nk = len(N)\nmod = 10**9+7\nDP = [[0,0] for i in range(k+1)]\nDP[0][0] = 1\nDP[0][1] = 0\nfor i in range(1,k+1):\n if N[i-1] == "1":\n DP[i][0] = (DP[i-1][0]*2)%mod\n DP[i][1] = (DP[i-1][1]*3+DP[i-1][0])%mod\n if N[i-1] == "0":\n DP[i][0] = DP[i-1][0]\n DP[i][1] = (DP[i-1...
['Wrong Answer', 'Accepted']
['s707877628', 's084876607']
[3064.0, 2940.0]
[18.0, 17.0]
[343, 81]
p03011
u908481359
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['dists = sorted(list(map(int, input().split())))\n\ndists.pop()\nprint(dists)', 'dists = sorted(list(map(int, input().split())))\n\ndists.pop()\nprint(sum(dists))']
['Wrong Answer', 'Accepted']
['s045912977', 's359173554']
[2940.0, 2940.0]
[17.0, 17.0]
[73, 78]
p03011
u910369451
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N = int(input())\nW = list(map(int,input().split()))\nm = sum(W)\n\nfor j in range(N-1):\n W1 = W[:j+1]\n W2 = W[j+1:N]\n s = abs(sum(W1) - sum(W2))\n m = min(m, s)\n\nprint(m)\n', 'P,Q,R = map(int, input().split())\nA = [P+Q, P+R, R+Q]\nprint(min(A)) ']
['Runtime Error', 'Accepted']
['s151567007', 's150019715']
[9044.0, 2940.0]
[26.0, 17.0]
[179, 68]
p03011
u911276694
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['L=list(map(int,input().split()))\n\tprint(sum(L)-max(L))', 'L=list(map(int,input().split()))\nprint(sum(L)-max(L))']
['Runtime Error', 'Accepted']
['s336192091', 's829645645']
[2940.0, 2940.0]
[17.0, 17.0]
[54, 53]
p03011
u911438260
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
["N, M = map(int,input().split())\na = list(map(int,input().split()))\np = 10**9 + 7\na.insert(0, -1)\na.append(N+1)\n\ndef mod(n,p):\n return n % p\n\nnk = [1]\nfor i in range(1,N+1):\n nk.append(mod((nk[-1] * i), p))\n\n\ndef bunbo(A, p): \n \n pp = p-2\n pb = list(str(format(pp, 'b')))\n \n pb.r...
['Runtime Error', 'Accepted']
['s619867421', 's600319436']
[3064.0, 2940.0]
[18.0, 17.0]
[1378, 68]
p03011
u912179452
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['lis = input().split()\n\nn_lis = list(map(int, lis))\n\nq = max(n_lis)\nn_lis.remove(max(n_lis))\nprint(q + max(n_lis))\n', 'l = list(map(int, input().split()))\n\nprint(sum(l) - max(l))\t\n\t']
['Wrong Answer', 'Accepted']
['s544858245', 's578306000']
[2940.0, 2940.0]
[17.0, 18.0]
[114, 62]
p03011
u919734978
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a, b, c = map(int, input().split())\n\nprint(sum(a,b,c) - max(a,b,c))', 'a = list(map(int, input().split()))\n\nprint(sum(a) - max(a))\n']
['Runtime Error', 'Accepted']
['s484065219', 's384552283']
[3064.0, 2940.0]
[22.0, 17.0]
[67, 60]
p03011
u921773161
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N_M = list(map(int, input().split()))\nN = N_M[0]\nM = N_M[1]\ndis = []\nfor _ in range(M):\n dis.append(input())\n\ndp = [0 for i in range(N+2)]\ndp[0] = 1\nif 1 in dis:\n dp[1] = 0\nelse :\n dp[1] = 1\n\nfor i in range(N):\n if i+2 in dis:\n dp[i+2]=0\n else:\n if i in dis :\n ...
['Runtime Error', 'Accepted']
['s272606523', 's080706711']
[3064.0, 2940.0]
[17.0, 17.0]
[429, 126]
p03011
u923341003
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['P, Q, R = map(int, input().split())\nmin(P+Q, P+R, Q+R)', 'P, Q, R = map(int, input().split())\nprint(min(P+Q, P+R, Q+R))']
['Wrong Answer', 'Accepted']
['s838294392', 's251348716']
[2940.0, 2940.0]
[17.0, 17.0]
[54, 61]
p03011
u925712467
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
["try:\n n=list(map(int, input().strip().split()))\n lis1=[]\n for i in range(0,len(n)):\n for a in range(0,len(n)):\n z=(int(n[a])+int(n[i]))\n lis1.append(z)\n set1=set((lis1))\n lis1=list((set1))\n minscore='9999999999'\n for i in range(0,len(lis1)):\n if floa...
['Wrong Answer', 'Accepted']
['s615396535', 's595872233']
[9200.0, 9168.0]
[29.0, 26.0]
[417, 416]
p03011
u927534107
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['l = sorted.list(map(int,input().split()))\nprint(l[0]+l[1])', ' l = sorted(list(map(int,input().split())))\n print(l[0]+l[1])', 'l = sorted(list(map(int,input().split())))\nprint(l[0]+l[1])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s147682035', 's522967980', 's140285752']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[58, 67, 59]
p03011
u930574673
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N, M = map(int, input().split())\nm = 0\nif M > 0:\n broken = int(input())\nelse:\n broken = 0\na1, a2, a3 = 1, 0, 0\nfor i in range(1, N+1):\n a3, a2 = a2, a1\n if i == broken:\n a1 = 0\n m += 1\n if m < M:\n broken = int(input())\n else:\n a1 = (a2 + a3) % 1000000007\nprint(a1)', 'l = sorted([...
['Runtime Error', 'Accepted']
['s407031629', 's488886389']
[3064.0, 3316.0]
[17.0, 21.0]
[286, 62]
p03011
u933249552
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['P,Q,R = map(int,input().split())\na= P+Q\nb = Q+R\nc = R+P\nptint(min([a,b,c])', 'xyz = input().split()\nx,y,z = int(xyz=[0]), int(xyz[1]),int(xyz[2])\n\na = x + y\nb = y + z\nc = z + x\nptint(min([a,b,c])', 'xyz = input().split()\nx,y,z = int(xyz=[0]), int(xyz[1]),int(xyz[2])\n\na = x + y\nb = y + z\nc = z + x\nprin...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s456308382', 's664916575', 's869684506', 's884404543', 's979082681', 's870825490']
[2940.0, 2940.0, 3060.0, 2940.0, 3064.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 18.0]
[74, 117, 120, 126, 1112, 95]
p03011
u934868410
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p,q,r = map(int, input().split())\nprint(p+q, min(q+r, r+p))', 'p,q,r = map(int, input().split())\nprint(min(p+q, min(q+r, r+p)))']
['Wrong Answer', 'Accepted']
['s971074842', 's646545784']
[3064.0, 2940.0]
[17.0, 18.0]
[59, 64]
p03011
u935522051
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['x = list[map(int,input().split())]\nb = sum(x)-max(x)\nprint(b)', 'x = list(map(int,input().split()))\nb = sum(x)-max(x)\nprint(b)']
['Runtime Error', 'Accepted']
['s813981697', 's002435469']
[2940.0, 2940.0]
[17.0, 17.0]
[61, 61]
p03011
u936705814
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a,b,c=input().split()\nprint(a)', 'a,b,c=input().split()\na=int(a)\nb=int(b)\nc=int(c)\nif a+b <= a+c and a+b <= b+c:\n print(a+b)\nelif a+c <= a+b and a+c <= b+c:\n print(a+c)\nelse:\n print(b+c)']
['Wrong Answer', 'Accepted']
['s369253578', 's412739412']
[2940.0, 3060.0]
[17.0, 17.0]
[30, 161]
p03011
u939555793
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['import sys\ndata = sys.stdin.readlines()\nprint(data[0].split())\ninputs = [int(x) for x in data[0].split()]\ninputs.sort()\nprint(inputs[0] + inputs[1])', 'import sys\ndata = sys.stdin.readlines()\ninputs = [int(x) for x in data[0].split()]\ninputs.sort()\nprint(inputs[0] + inputs[1])']
['Wrong Answer', 'Accepted']
['s822139645', 's335391195']
[3064.0, 2940.0]
[17.0, 18.0]
[148, 125]
p03011
u939951826
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a,b,c = map(int, input().split())\nprint(min(2*(a+b+c - max(a,b,c)), a+b+c))', 'a,b,c = map(int, input().split())\nprint(a+b+c - max(a,b,c))']
['Wrong Answer', 'Accepted']
['s786077210', 's485916569']
[2940.0, 2940.0]
[17.0, 17.0]
[75, 59]
p03011
u940831163
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a, b, c = map(int, input().split())\n\nprint(min(a+b,b+c,c+A))\n', 'p, q, r = map(int, input().split())\nprint(min(p+q, q+r, r+p))\n']
['Runtime Error', 'Accepted']
['s231647155', 's302619056']
[2940.0, 2940.0]
[17.0, 17.0]
[69, 62]
p03011
u953379577
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a,b,c = map(int,input().split())\n\ns = sum(a,b,c)\n\nprint(s-max(a,b,c))', 'a,b,c = map(int,input().split())\n \ns = a+b+c\n \nprint(s-max(a,b,c))']
['Runtime Error', 'Accepted']
['s095586684', 's893399965']
[2940.0, 2940.0]
[17.0, 17.0]
[69, 66]
p03011
u953486781
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['P = int(input())\nQ = int(input())\nR = int(input())\n\nX = min[P, Q, R]\n\nprint(P + Q + R - X)', 'p = input()\nq = input()\nr = input()\n\ns = int(p)\nt = int(q)\nu = int(r)\n\n\nx = max([s, t, u])\n\nprint(s + t + u - x)', 'P = int(input())\nQ = int(input())\nR = int(input())\n\nX = min([P, Q, R])\n\nprint(P + Q +...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s047845213', 's341456262', 's391310523', 's434055606', 's660565379', 's704072109']
[2940.0, 3060.0, 2940.0, 3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[90, 112, 92, 185, 92, 79]
p03011
u953868469
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['S = input().split() \n\nA = int(S[0])\nB = int(S[1])\nC = int(S[2])\nanswer_1 = A + B\nanswer_2 = A + C\nanswer_3 = B + C\n\nprint(max(answer_1,answer_2,answer_3))\n', 'A, B, C = stdin.readline().rstrip().split()\nanswer_1 = A + B\nanswer_2 = A + C\nanswer_3 = B + C\n\nprint(max(answer_1,answer_2,answer_3))', 'A, B,...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s168831294', 's240070920', 's392886652', 's700484739']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[156, 134, 167, 156]
p03011
u957167787
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N, M = map(int, input().split())\na = [int(input()) for _ in range(M)] # a_0...a_(M-1)\n\ndef fib(x): \n a, b = 1, 1\n if x == 0:\n return a\n elif x == 1:\n return b\n else:\n for i in range(x-1):\n a, b = b, a + b\n return b\n"""\n# 再帰だとTLEとかREとかになるよ\ndef fib(x): \...
['Runtime Error', 'Accepted']
['s508875123', 's141540936']
[3064.0, 3316.0]
[17.0, 21.0]
[1107, 73]
p03011
u960570220
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p, q, r = map(int, input().split())\n\nprint(sum[p, q, r] - max[p, q, r])\n', 'p, q, r = map(int, input().split())\ntime = [p, q, r]\n\nprint(sum(time) - max(time))\n']
['Runtime Error', 'Accepted']
['s963953736', 's241176208']
[8996.0, 9056.0]
[24.0, 25.0]
[72, 83]
p03011
u961226684
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['P, Q, R = map(int, input().split())\nabc = P+Q\nacb = P+R\ncab = R+Q\n\nans = 10000\nans = min(ans, abc)\nans = min(ans, acb)\nans = min(ans, dca)\nprint(ans)\n', 'P, Q, R = map(int, input().split())\nabc = P+Q\nacb = P+R\ncab = R+Q\n\nans = 10000\nans = min(ans, abc)\nans = min(ans, acb)\nans = min(ans, cab)\nprint(...
['Runtime Error', 'Accepted']
['s286954797', 's784762719']
[2940.0, 2940.0]
[17.0, 17.0]
[150, 150]
p03011
u962479059
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['s=map(int, input().split())\nfor i in range(3):\n s[i]=int(s[i])\ns.sort()\nprint(s[0]+s[1])', 's=input().split()\nfor i in range(3):\n s[i]=int(s[i])\ns.sort()\nprint(s[0]+s[1])']
['Runtime Error', 'Accepted']
['s234072329', 's096186738']
[2940.0, 2940.0]
[17.0, 17.0]
[91, 81]
p03011
u965937045
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['i = list(map(int, input().split())) \ni=(sorted(i,reverse=True))\nprint(i[0]+i[1])', 'a,b,c= map(int, input().split()) \nprint(min(a+b,b+c,c+a))']
['Wrong Answer', 'Accepted']
['s674697195', 's276861636']
[9100.0, 9088.0]
[29.0, 27.0]
[122, 99]
p03011
u969190727
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p,q,r=map(int,input().split())\n\nprint(min([p+q,q+r,r+p])', 'p,q,r=map(int,input().split())\n\nprint(min([p+q,q+r,r+p]))\n']
['Runtime Error', 'Accepted']
['s033573107', 's396482730']
[2940.0, 2940.0]
[17.0, 17.0]
[56, 58]
p03011
u970308980
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N, M = map(int, input().split())\nMOD = 1000000007\n\nbroken = []\nfor i in range(M):\n broken.append(int(input()))\n\ndp = [0] * (N + 2)\ndp[N] = 1\nfor i in reversed(range(N)):\n if i in broken:\n dp[i] = 0\n if len(broken) != 0:\n broken.pop(-1)\n continue\n dp[i] = (dp[i+1...
['Runtime Error', 'Accepted']
['s244129420', 's792038757']
[3064.0, 2940.0]
[18.0, 19.0]
[336, 67]
p03011
u971715376
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['s=list(map(int,input().split()))\na=max(s)\nb=min(s)\nprint(a+b)\n', 'P,Q,R=map(int,input().split())\ns=[P+Q,P+R,Q+R]\nprint(min(s))\n']
['Wrong Answer', 'Accepted']
['s744211266', 's901612364']
[2940.0, 2940.0]
[18.0, 17.0]
[62, 61]
p03011
u973108807
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['array = list(map(int, input().split())).sort()\nprint(array[0]+array[1])', 'array = sorted(list(map(int, input().split())))\nprint(array[0]+array[1])']
['Runtime Error', 'Accepted']
['s494368844', 's323289613']
[2940.0, 3064.0]
[18.0, 17.0]
[71, 72]
p03011
u975485663
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
["T=list(map(int,input().split(' '))).sort()\nprint(sum(T[-1]))\n", "T=list(map(int,input().split(' ')))\nT.sort()\nprint(sum(T[:2]))\n"]
['Runtime Error', 'Accepted']
['s354076382', 's911893169']
[2940.0, 2940.0]
[17.0, 17.0]
[61, 63]
p03011
u977642052
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
["\n\nfrom itertools import permutations\n\n\ndef main(p, q, r):\n _max = 100\n\n for p in permutations([p, q, r], 2):\n if _max > sum(p):\n _max = sum(p)\n\n print(_max)\n\n\nif __name__ == '__main__':\n p, q, r = map(int, input().split(' '))\n main()\n", "\n\nfrom itertools import per...
['Runtime Error', 'Accepted']
['s099972579', 's826060456']
[3188.0, 3060.0]
[18.0, 17.0]
[377, 417]
p03011
u986515404
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['from sys import stdin\nfrom functools import reduce\nfrom operator import add, mul\n\nfrom functools import lru_cache\n@lru_cache(maxsize=None) \ndef fib(n): \n if n <= 0:\n return 0\n elif n == 1:\n return 1\n else:\n return fib(n - 2) + fib(n - 1)\n\n\nnm = [int(i) for i in stdin.rea...
['Runtime Error', 'Accepted']
['s157843065', 's385396901']
[3572.0, 2940.0]
[23.0, 17.0]
[684, 121]
p03011
u989385104
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['N,M = map(int,input().split())\nS = []\nfor _ in range(M):\n S.append(int(input()))\nS.append(-1)\nS.append(N+1)\nS.sort() \nP = 1\n\ndef Fib(n): \n if n == 1:\n return 0\n elif n == 2:\n return 1\n else:\n return Fib(n-1)+Fib(n-2)\n \nfor i in range(M+1):\n P *= Fib(S[i+1]-S[...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s041893397', 's695860172', 's960662344', 's758099344']
[3064.0, 3064.0, 3064.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[325, 447, 428, 63]
p03011
u991619971
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['a = int().split()\n\nb = l[0]+l[1]\nc = l[1]+l[2]\nd = l[2]+l[0]\n\ne=list[]\ne.append(b)\ne.append(c)\ne.append(d)\n\nprint(min(e))', 'a = input().split()\nprint(a)\nb = int(a[0])+int(a[1])\nc = int(a[1])+int(a[2])\nd = int(a[2])+int(a[0])\n\ne=list()\ne.append(b)\ne.append(c)\ne.append(d)\nprint(e)\nprint(min(e))\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s404035991', 's826947881', 's419062751']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[121, 170, 157]
p03011
u994521204
2,000
1,048,576
There are three airports A, B and C, and flights between each pair of airports in both directions. A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours. Consider a route where we start at one of th...
['p, q, r = map(int, input().split())\nprint(sum(p, q, r) - max(p, q, r))\n\n', 'a,b,c=map(int,input().split())\nA=list(a,b,c)\nprint(sum(A)-max(A))', 'p, q, r = map(int, input().split())\nprint(sum([p, q, r]) - max(p, q, r))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s022277838', 's690501699', 's702834570']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[72, 65, 73]
p03012
u000085263
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['inp = int(input())-1\nlist = list(map(int,input().split()))\ndef xx(a):\n if a<0:\n return a*(-1)\n else:\n return a\ndef xxx(listing):\n cc=0\n for all in listing:\n cc=all+cc\n return cc\nans = xx(xxx(list[0:1]) - xxx(list[1:inp+1]))\nfor iterater in range(1,inp):\n iterater=ite...
['Wrong Answer', 'Accepted']
['s082697536', 's023856492']
[9148.0, 9172.0]
[30.0, 29.0]
[409, 244]
p03012
u007785897
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\nW = [int(i) for i in input().split()]\ns = sum(W)\na = 0\n\nfor i in range(N):\n\t_ = a + W[i]\n\tif abs(a - (s - a)) <= abs(_ - (s - _)):\n\t\tbreak\n\telse:\n\t\ta = _\n\nprint abs(a-(s - a))', 'N = int(input())\nW = [int(i) for i in input().split()]\ns = sum(W)\na = 0\n\nfor i in range(N):\n\t_ =...
['Runtime Error', 'Accepted']
['s934457463', 's212935243']
[2940.0, 3060.0]
[17.0, 17.0]
[192, 193]
p03012
u010069411
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nW=list(map(int,input().split()))\ns = sum(W)\ns2 = s//2\n\na=[0]\nk=[]\nsss = 0\nfor w in W:\n sss += w\n a.append(sss)\n k.append(a[-1] - a[-2])\nprint(min(k))\n', 'N=int(input())\nW=list(map(int,input().split()))\ns = sum(W)\ns2 = s//2\n\na=[]\nk=[]\nsss = 0\nfor i,w in enumerate(W):\n s...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s153300346', 's830465842', 's908101131', 's890960547']
[3060.0, 3060.0, 2940.0, 3060.0]
[19.0, 17.0, 17.0, 17.0]
[174, 204, 173, 187]
p03012
u015593272
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
["N = int(input())\nWeight = list(map(int, input().split()))\n\ndiff = float('inf')\nsumm = sum(Weight)\npart = 0\n\nfor i in range(0, N-1):\n part += Weight[i]\n diff = min(diff, abs(summ - part))\n\nprint(diff)", "N = int(input())\nWeight = list(map(int, input().split()))\n\ndiff = float('inf')\nsumm = sum(Weig...
['Wrong Answer', 'Accepted']
['s055678649', 's859639946']
[3060.0, 3060.0]
[17.0, 17.0]
[205, 209]
p03012
u020639289
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['s = input()\nw_list = s.split()\nw_list.sort(reverse=True)\nprint(w_list)\nleft_sum = right_sum = 0 \nfor w in w_list:\n if left_sum <= right_sum:\n left_sum += int(w)\n else:\n right_sum += int(w)\n\nprint(abs(left_sum - right_sum))', 'n = input()\ns = input()\ns_list = s.split()\ns_list = [int(e...
['Wrong Answer', 'Accepted']
['s186668728', 's115492586']
[3060.0, 3064.0]
[17.0, 17.0]
[242, 404]
p03012
u023229441
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nA=list(map(int,input().split()))\nQ=[]\nfor i in range(1,n):\n Q.append(sum(A[:i])-sum(A[i:]))\nprint(min(Q))', 'n=int(input())\nA=list(map(int,input().split()))\nQ=[]\nfor i in range(1,n):\n Q.append(abs(sum(A[:i])-sum(A[i:])))\nprint(min(Q))\n']
['Wrong Answer', 'Accepted']
['s871886051', 's661746551']
[2940.0, 2940.0]
[18.0, 17.0]
[121, 127]
p03012
u026788530
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\n\nW = [int(x)for x in input().split()]\n\nS = sum(W)\nt = 0\nk = S\nfor i in range(N):\n t += W[i]\n k = S-t\n if t > k:\n print(abs(t-k))\n break\n', 'N = int(input())\n\nW = [int(x)for x in input().split()]\n\nS = sum(W)\nt = 0\nk = S\nans = [0 for i in range(N)]\nfor i in r...
['Wrong Answer', 'Accepted']
['s028441556', 's197225449']
[2940.0, 3064.0]
[18.0, 17.0]
[176, 176]
p03012
u027675217
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nw=list(map(int,input().split()))\nsum=sum(w)\nsum1=0\nfor i in range(len(w)):\n\tsum-=w[i]*2 \n\tif sum<0: \n\t\tsum1=sum+w[i]\n\t\tif abs(sum)<=abs(sum1): \n\t\t\tprint(sum)\n\t\telse:\n\t\t\tprint(sum1)\n', 'n=int(input())\nw=list(map(int,input().split()))\nsum=sum(w)\nans=[]\nfor i in range(len(...
['Wrong Answer', 'Accepted']
['s695767995', 's011725782']
[3060.0, 2940.0]
[17.0, 17.0]
[312, 141]
p03012
u032222383
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nw=list(map(int,input().split()))\nmin=1000000\ntotal=sum(w)\nfor i in range(n-2):\n s1=sum(w[0:i+1])\n s2=total-s1\n dis=abs(s1-s2)\n if dis<=min:\n min=dis\n\nprint(min)', 'n=int(input())\nw=list(map(int,input().split()))\nmin=1000000\ntotal=sum(w)\nfor i in range(n-1):\n s1=sum...
['Wrong Answer', 'Accepted']
['s003104869', 's927940196']
[3060.0, 3060.0]
[17.0, 17.0]
[194, 194]
p03012
u033524082
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nl=list(map(int,input().split()))\ns=sum(l)\nm=[]\nfor i in range(1,n-1):\n m.append(abs(-sum(l[:i])*2))\nprint(min(m))', 'n=int(input())\nl=list(map(int,input().split()))\ns=sum(l)\nm=[]\nfor i in range(1,n-1):\n m.append(abs(s-sum(l[:i])*2))\nprint(min(m))', 'n=int(input())\nl=list(map(int,inpu...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s311289913', 's779437255', 's787374097']
[3060.0, 3060.0, 3060.0]
[17.0, 18.0, 17.0]
[131, 132, 130]
p03012
u037221289
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
["N = int(input())\nW = list(map(int,input().split(' ')))\nMIN = float('inf')\n\nfor i in range(0,N-1):\n a = sum(W[:i])\n b = sum(W[i:])\n MIN = min(MIN,abs(a-b))\nprint(MIN)", "N = int(input())\nW = list(map(int,input().split(' ')))\nMIN = float('inf')\n\nfor i in range(1,N):\n a = sum(W[:i])\n b = sum(W[i:])\n ...
['Wrong Answer', 'Accepted']
['s117484800', 's910710195']
[3060.0, 3060.0]
[18.0, 17.0]
[168, 166]
p03012
u038815010
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['ans=10**10\nn=int(input())\nw=list(map(int,input().split()))\nfor i in range(1,n):\n ans=min(ans,abs(sum(w[:i])-sum(w[i:])))\n\nprint(ans)AC', 'ans=10**10\nn=int(input())\nw=list(map(int,input().split()))\nfor i in range(1,n):\n ans=min(ans,abs(sum(w[:i])-sum(w[i:])))\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s737672347', 's740729006']
[2940.0, 3060.0]
[17.0, 17.0]
[137, 135]
p03012
u054825571
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nS=list(map(int, input().split()))\nA=[]\nfor i in range(1,N-1):\n A.append(abs(sum(S[:i])-sum(S[i:])))\nprint(min(A) if not A==[] else abs(S[0]-S[1]))', 'N=int(input())\nS=list(map(int, input().split()))\nA=[]\nfor i in range(1,N-1):\n A.append(abs(sum(S[:i])-sum(S[i:])))\nprint(min(A))', 'N=int(inp...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s089081697', 's361535003', 's613228465', 's409964079']
[9088.0, 8976.0, 9096.0, 9084.0]
[26.0, 28.0, 24.0, 28.0]
[162, 129, 119, 160]
p03012
u059436995
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = input()\nw = list(map(int, input().split()))\nw = np.array(w)\nprint(np.min(np.abs(2 * np.cumsum(w) -np.sum(w))))', 'n = int(input())\nw = list(map(int, input().split()))\nans = sum(w)\nfor i in range(1,n):\n ans = min(ans,abs(sum(w[:i + 1]) - sum(w[i +1:])))\nprint(ans)']
['Runtime Error', 'Accepted']
['s242383536', 's727918785']
[2940.0, 3060.0]
[18.0, 18.0]
[114, 152]
p03012
u063962277
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = [int(i) for i in input().split()]\nans = 999999999\nfor i in range(1,n-1):\n g1 = w[0:i]\n g2 = w[i:n]\n d = abs(sum(g1)-sum(g2))\n if d <= ans:\n ans = d\nprint(ans)', 'n = int(input())\nw = [int(i) for i in input().split()]\nans = 999999999\nfor i in range(1,n):\n g1 = w[...
['Wrong Answer', 'Accepted']
['s607061783', 's127065006']
[3064.0, 3060.0]
[18.0, 17.0]
[198, 196]
p03012
u065375429
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['# B\n# Balance\n\nN = int(input())\nW = [int(x) for x in input().split(" ")]\n\n#print(N)\n#print(W)\n\ndiff = []\n\nimport numpy as np\n\nfor T in range(N - 1):\n\n S1 = np.sum(W[:T])\n S2 = np.sum(W)-S1\n diff.append(int(np.abs(S1-S2)))\n\nprint(np.min(diff))', '# B\n# Balance\n\nN = int(input())\nW = [int...
['Wrong Answer', 'Accepted']
['s921652111', 's439903940']
[12504.0, 12504.0]
[155.0, 153.0]
[251, 247]
p03012
u069386342
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\n\nW = list(map(int,input().split()))\nmin = 9999999999\ntmp1= 0\ntmp2= 0\nfor t in range(N-1):\n tmp1 = 0\n tmp2 = 0\n for i in range(len(W[:t])):\n tmp1 +=W[i]\n \n for i in range(len(W[t:])):\n tmp2 +=W[i+len(W[:t])]\n\n if min > abs(tmp1-tmp2):\n min = abs(t...
['Wrong Answer', 'Accepted']
['s042537014', 's730683864']
[3064.0, 3188.0]
[20.0, 20.0]
[325, 374]
p03012
u074338678
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = list(map(int, input().split()))\nl = []\n\nfor i in range(1, n):\n l.append(abs( sum(w[:t]) -sum(w[t:]) ))\n \nprint(min(l))', 'n = int(input())\nw = list(map(int, input().split()))\nl = []\n\nfor i in range(1, n):\n l.append(abs(sum(w[i:]) - sum(w[:t])))\n \nprint(min(l))', 'n = int(input()...
['Runtime Error', 'Runtime Error', 'Accepted']
['s130182320', 's898668930', 's079720603']
[3060.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0]
[141, 140, 142]
p03012
u076306174
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['import sys\nn=int(input())\nw=list(map(int, input().split()))\n\nw_sum=sum(w)\ns=0\ncnt=0\nfor i in w:\n s+=i\n cnt+=1\n if s >= w_sum/2:\n print(cnt)\n break', 'import sys\nn=int(input())\nw=list(map(int, input().split()))\n\nw_sum=sum(w)\ns=0\ncnt=0\nfor i in w:\n s+=i\n cnt+=1\n if...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s951704676', 's994624307', 's307666414']
[3060.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[170, 179, 171]
p03012
u079022116
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nw=list(map(int,input().split()))\nm = sum(w)//2\ns = 0\nfor i in range(n):\n s += w[i]\n if s >= m:\n if s == m:\n print(0)\n else:\n print(abs(m-s)+1)\n break', 'n = int(input())\nw = list(map(int,input().split()))\nans = []\ns = 0\nfor i in range(n):\n s += w[i]\n ans.ap...
['Wrong Answer', 'Accepted']
['s351726911', 's270523521']
[3060.0, 3060.0]
[17.0, 17.0]
[187, 151]
p03012
u084320347
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = list(map(int,input().split()))\nprint(w)\nans = 100000\nfor i in range(1,n):\n ans = min(ans, abs(sum(w[:i])-sum(w[i:])))\n\n\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\nres = 1000\nfor i in range(n-1):\n print(2*sum(a[:i]))\n res = min(res,abs(sum(a[:i+1])-sum(a...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s211724277', 's909411676', 's314650626']
[3060.0, 3060.0, 2940.0]
[18.0, 19.0, 18.0]
[155, 166, 146]
p03012
u089230684
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nw=list(map(int, input().split()))\nS=sum(w)\nprint(S)\nk=0\nans=10**7\n\nfor i in range(N-1):\n k+=w[i]\n if abs(S-2*k)<=ans:\n ans=abs(S-2*k)\n print(ans)\n\nprint(ans)', 'N=int(input())\nw=list(map(int, input().split()))\nS=sum(w)\nk=0\nans=10**7\n\nfor i in range(N-1):\n k+=w...
['Wrong Answer', 'Accepted']
['s467145289', 's759374553']
[3064.0, 3060.0]
[18.0, 61.0]
[192, 164]
p03012
u089376182
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw_list = list(map(int, input().split()))\nprint(min([abs(s[:i]-s[i:]) for i in range(1, n)]))', 'n = int(input())\nw_list = list(map(int, input().split()))\nprint(min([abs(sum(w_list[:i])-sum(w_list[i:])) for i in range(1, n)]))\n']
['Runtime Error', 'Accepted']
['s159510723', 's235044608']
[3064.0, 2940.0]
[17.0, 17.0]
[109, 130]
p03012
u092061507
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['import sys\n\nN = int(input())\nW = list(map(int,input().split()))\n\ndif = math.inf\n\nfor i in range(1,N):\n tmp = abs(sum(W[:i]) - sum(W[i:]))\n if dif > tmp:\n dif = tmp\nprint(dif)\n', 'import sys\nimport math\nN = int(input())\nW = list(map(int,input().split()))\n\ndif = math.inf\n\nfor i in range(...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s644221352', 's683549936', 's735369299', 's167681108']
[2940.0, 3060.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 19.0]
[188, 216, 210, 190]
p03012
u095021077
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nW=list(map(int, input().split()))\n\noutput=abs(W[0]-sum(W[1:]))\nfor i in range(2, N-1):\n temp=abs(sum(W[:i])-sum(W[i:]))\n if output<temp:\n output=temp.copy()\n \nprint(output)', 'N=int(input())\nW=list(map(int, input().split()))\n\nprint(np.min([np.abs(np.sum(W[:t])-np.sum(W[t:])) for t i...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s193995677', 's319685232', 's356631871', 's632012413', 's647941347', 's903563036', 's739763872']
[3060.0, 3060.0, 3060.0, 2940.0, 2940.0, 12428.0, 3060.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 155.0, 17.0]
[195, 125, 188, 126, 121, 144, 186]
p03012
u095756391
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\n\nw = list(map(int, input().split()))\n\nsubs = []\ns = 0\nfor i in range(n):\n s += w[i]\n subs.append(s)\n\nans = 1000\nfor i in range(n-1):\n a = abs(subs[-1] - subs[i])\n ans = min(ans, a)\n\nprint(ans)', 'n = int(input())\n\nw = list(map(int, input().split()))\n\nsubs = []\ns = 0\nf...
['Wrong Answer', 'Accepted']
['s038215976', 's335692229']
[3064.0, 3060.0]
[17.0, 17.0]
[221, 224]
p03012
u098588273
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n=int(input())\nw=list(map(int,input().split()))\nall_weight=0\nweight=0\nfor i in range(n):\n all_weight+=w[i]\nfor j in range(n):\n weight+=w[j]\n if weight>=all_weight//2:\n print(abs(weight-(all_weight-weight)))', 'n=int(input())\nw=list(map(int,input().split()))\nprint(min([abs(sum(w[:i])-sum(w[i:])) for i...
['Wrong Answer', 'Accepted']
['s595156578', 's201628093']
[3060.0, 3060.0]
[17.0, 18.0]
[212, 108]
p03012
u102242691
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['\nn = int(input())\nw = list(map(int,input().split()))\nl = []\nr = []\nprint(w)\n\nmin = abs(w[0] - sum(w[1:]))\n#print(min)\ns1 = 0\ns2 = 0\n\nfor i in range(n-1):\n s1 = sum(w[:i+1])\n s2 = sum(w[i+1:])\n tmp = abs(s1 - s2)\n print(s1,s2,tmp)\n if tmp < min:\n min = tmp\n\nprint(min)\n', '\nn...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s186043435', 's303048831', 's084715113']
[3064.0, 3064.0, 3060.0]
[18.0, 17.0, 17.0]
[290, 291, 204]
p03012
u103305058
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = list(map(int,input(),split()))\nans = 1000000000\nfor t in range(1, n);\n left = sum(w[:t])\n right = sum(w[t:])\n ans = min(ans , abs(left - right))\nprint(ans)\n ', 'n = int(input())\nw = list(map(int,input().split()))\nans = 1000000000\nfor t in range(1, n):\n left = sum(w[...
['Runtime Error', 'Accepted']
['s505972993', 's493140702']
[2940.0, 2940.0]
[17.0, 18.0]
[194, 194]
p03012
u103902792
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nws = list(map(int,input().split()))\nothers = [0]\ndiff = 999999999999\nfor i in range(n):\n d= abs(sum(ws)-sum(other))\n if d < diff:\n diff = d\n others.add(ws.pop(0))\nprint(diff)', "n = int(input())\nWs = list(map(int,input().split()))\n\nans = float('inf')\n\nfor i in range(n):\n ans = m...
['Runtime Error', 'Accepted']
['s484492135', 's265831088']
[3060.0, 8980.0]
[17.0, 29.0]
[197, 155]
p03012
u104442591
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = [int(i) for i in input().split()]\nd = [abs(w[:i]-w[i:]) for i in range(1, n-1)]\nprint(min(d))', 'n = int(input())\nw = [int(i) for i in input().split()]\nd = [abs(sum(w[:i])-sum(w[i:])) for i in range(1, n-1)]\nprint(min(d))', 'n = int(input())\nw = [int(i) for i in input().split()]\nd = [abs(...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s040108811', 's664089765', 's943856029', 's479379592']
[3060.0, 3060.0, 3060.0, 2940.0]
[17.0, 18.0, 17.0, 17.0]
[114, 124, 124, 122]
p03012
u104740664
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['import numpy as np\nN = int(input())\nW_list = [int(i) for i in input().split(" ")]\nans = np.abs(W_list[0] - np.sum(W_list[1:N]))\nsum_list = np.sum(W_list)\nsum_front = 0\nfor j in range(2, N):\n \tsum_front += W_list[j]\n difference = np.abs(sum_list - 2 * sum_front)\n if difference < ans:\n ans = di...
['Runtime Error', 'Accepted']
['s045087012', 's567632585']
[2940.0, 12448.0]
[17.0, 154.0]
[352, 338]
p03012
u109436774
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = list(map(int,input().split()))\n \nimport numpy as np\n \na = np.cumsum(W)\n \nprint(int(min(abs(sum(w)/2 - a))*2))', 'a = list(map(int,input().split()))\ndifference = 100\nfor i in range(len(a)):\n if abs(sum(a[:i]) - sum(a[i:])) < difference:\n difference = abs(sum(a[:i]) - sum(a[i:]...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s389393288', 's491321434', 's515168572', 's678826868']
[12772.0, 9116.0, 9176.0, 9096.0]
[154.0, 30.0, 28.0, 30.0]
[130, 194, 194, 389]
p03012
u112567325
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nW = list(map(int,input().split()))\ntmp = 10000000\nfor i in range(2,N):\n if tmp >= abs(sum(W[:i+1]) - sum(W[i:])):\n tmp = i\nprint(tmp)', 'N=int(input())\nW = list(map(int,input().split()))\ntmp = 10000000\nfor i in range(N):\n if tmp >= abs(sum(W[:i+1]) - sum(W[i:])):\n ans = i-1\nprint(an...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s333238458', 's546723960', 's691229335']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0]
[152, 152, 175]
p03012
u113971909
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N =inptut()\nS = map(int,imput().split())\nTT = sum(TT)\nT1 = 0\nAns = TT\nfor i in range(N):\n T1 += S[i]\n Ans = min(Ans,ABS(TT-T1-T1))\nprint(Ans)', 'N =int(input())\nS = map(int,input().split())\nTT = sum(TT)\nT1 = 0\nAns = TT\nfor i in range(N):\n T1 += S[i]\n Ans = min(Ans,ABS(TT-T1-T1))\nprint(Ans)', 'N =i...
['Runtime Error', 'Runtime Error', 'Accepted']
['s096176020', 's984775418', 's484935974']
[2940.0, 3060.0, 2940.0]
[17.0, 18.0, 17.0]
[143, 147, 153]
p03012
u115110170
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\narr = list(map(int,input().split()))\n\nsums = [0 for i in range(n)]\n\nwa = 0\nfor i in range(n):\n wa += arr[i]\n sums[i] = wa\n\nans = None\nlow = 1000000000\nfor i in range(n):\n t = abs(2*sums[i]-sums[-1])\n if t < low:\n low = t\n ans = i\nprint(ans)', 'n = int(input())\narr = list(m...
['Wrong Answer', 'Accepted']
['s375977292', 's464745504']
[3064.0, 3064.0]
[18.0, 17.0]
[267, 266]
p03012
u117193815
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['import math\nn = int(input())\nl=list(map(int ,input().split()))\nll=[]\nresult=[]\nresultlist=[]\nfor i in range(n-1):\n ll.append(abs(sum(l)-(sum(result)+l[i])))\n result.append(l[i])\nfor i in range(len(ll)-1):\n resultlist.append(abs(ll[i]-abs(ll[i]-sum(l)))) \nprint(min(resultlist))', 'n = int(input(...
['Wrong Answer', 'Accepted']
['s901137720', 's517631296']
[3064.0, 3060.0]
[18.0, 17.0]
[289, 139]
p03012
u117980998
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['result = 99999\nfor i in range(1,N):\n s = abs(sum(w[:i]) - sum(w[i:]))\n if s<result:\n result = s\nprint(result)', 'N = int(input())\nw = list(map(int,input().split()))\n\nresult = 99999\nfor i in range(1,N):\n s = abs(sum(w[:i]) - sum(w[i:]))\n if s<result:\n result = s\nprint(result)']
['Runtime Error', 'Accepted']
['s500484279', 's222517576']
[2940.0, 3060.0]
[17.0, 17.0]
[122, 175]
p03012
u118211443
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = list(map(int, input().split()))\nwa = 0\nfor i in range(len(w)):\n wa += w[i]\nwa2 = 0\nwa3 = 0\ni = 0\nwhile wa2 <= wa / 2:\n wa2 += w[i]\n i += 1\nfor j in range(i, len(w)):\n wa3 += w[j]\nprint(abs(wa2 - wa3))\nexit()', 'n = int(input())\nw = list(map(int, input().split()))\nwa = ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s085412912', 's312824314', 's932740947']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[240, 243, 161]
p03012
u131264627
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input())\nw = [map(int, input().split())]\nans = 0\nfor i in range(n):\n s1 = sum(w[:i])\n s2 = sum(w[i:])\n z = int(abs(s1 - s2))\n ans = min(ans, z)\nprint(ans)\n', 'n = int(input())\nw = [map(int, input().split())]\nans = 0\nfor i in range(n):\n s1 = sum(w[:i])\n s2 = sum(w[i:])\n z = ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s062493388', 's091609692', 's675749859', 's802528117', 's811846506', 's948278141', 's773614899']
[2940.0, 2940.0, 3068.0, 2940.0, 3060.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 18.0, 17.0]
[175, 170, 182, 170, 176, 185, 184]
p03012
u131944095
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\nw = list(map(int, input().strip().split()))\n#s = N/2\ns = 0\ndiff = []\n\nfor k in range(N):\n total_s1 = 0\n total_s2 = 0\n for i in range(N):\n if i < s:\n total_s1 += w[i]\n else:\n total_s2 += w[i]\n diff.append(abs(total_s1 - total_s2))\n s +=...
['Wrong Answer', 'Accepted']
['s197033663', 's724283434']
[3060.0, 3060.0]
[19.0, 19.0]
[335, 323]
p03012
u135116520
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N=int(input())\nW=list(map(int,input().split()))\ns=[]\nfor T in range(0,N-1):\n S_1=sum(W[0:T])\n S_2=sum(W[T:N])\n s.append(abs(S_1-S_2))\nprint(min(s))', 'N=int(input())\nW=list(map(int,input().split()))\ns=[]\nfor T in range(0,N-1):\n S_1=sum(W[0:T+1])\n S_2=sum(W[T+1:N])\n s.append(abs(S_1-S_2))\nprint(min...
['Wrong Answer', 'Accepted']
['s722379994', 's306106779']
[3060.0, 3060.0]
[17.0, 17.0]
[150, 154]
p03012
u141610915
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\nW = list(map(int, input().split()))\nAveW = sum(W) / 2\n\ntemp = 0\nfor i in W:\n temp += i\n if temp >= AveW:\n if temp - AveW >= AveW - temp + i:\n print(AveW * 2 - (temp + i) * 2)\n else:\n print((temp - AveW) * 2)\n break', 'N = int(input())\nW = list(map(int, input().split(...
['Wrong Answer', 'Accepted']
['s057606209', 's252151872']
[3060.0, 3064.0]
[17.0, 17.0]
[252, 271]
p03012
u141633765
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['N = int(input())\nW = list(map(int, input().split())) \n\nmin_diff = 1000\ntot_wt = sum(W)\nfor i in range(2**N):\n i_bit = list(map(int, list(np.binary_repr(i, N))))\n s1= np.dot(i_bit, W)\n s2 = tot_wt - s1\n if min_diff > abs(s1-s2):\n min_diff = abs(s1-s2)\n print(min_diff, i_bit)', 'imp...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s493004734', 's952505960', 's502661416']
[3060.0, 12492.0, 3060.0]
[17.0, 154.0, 17.0]
[300, 352, 208]
p03012
u142984055
2,000
1,048,576
We have N weights indexed 1 to N. The mass of the weight indexed i is W_i. We will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be th...
['n = int(input());\nw = list(map(int, input().split()))\n\nsum_list = sum(w);\nsum_list2 = sum_list/2;\n\nsum_of_all = 0;\ni = 0;\nwhile sum_of_all <sum_list2:\n sum_of_all += sum_list[i];\n i=i+1;\n \nprint(abs((sum_list-sum_of_all)-sum_of_all))', 'N = int(input())\nW = list(map(int, input().split()))\n \nsum_W = ...
['Runtime Error', 'Accepted']
['s758361053', 's523808501']
[3060.0, 3060.0]
[17.0, 17.0]
[236, 248]