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
p04033
u856232850
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a,b = list(map(int,input().split()))\n\nif a<=0 and 0 <= b:\n print('Zero')\nelif a <0 and b < 0:\n print('Positive')\nelse:\n n = abs(a-b)\n if n%2 == 0:\n print('Negative')\n else:\n print('Positive')", "a,b = list(map(int,input().split()))\n\nif a<=0 and 0 <= b:\n print('Zero')\nelif a >0 and b > 0:\n print('Positive')\nelse:\n n = abs(a-b)\n if n%2 == 0:\n print('Negative')\n else:\n print('Positive')"]
['Wrong Answer', 'Accepted']
['s653910749', 's527693022']
[3060.0, 3060.0]
[17.0, 18.0]
[220, 220]
p04033
u859897687
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
['a,b=map(int,input().split())\nif a*b<=0::\n print("Zero")\nelse:\n if a>0 or (b-a)%2>0:\n print("Positive")\n else:\n print("Negative")', 'a,b=map(int,input().split())\nif a*b<=0:\n print("Zero")\nelse:\n if a>0 or (b-a)%2>0:\n print("Positive")\n else:\n print("Negative")']
['Runtime Error', 'Accepted']
['s750406369', 's739841947']
[2940.0, 2940.0]
[17.0, 19.0]
[137, 136]
p04033
u864276028
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a,b = map(int, input().split())\nL = []\nfor i in range (a,b+1):\n L.append(i)\nP = 1\nfor j in L:\n P *= j\nif P > 0:\n print('Positive')\nelif P = 0:\n print('Zero')\nelse:\n print('Negetive')", 'a,b = map(int, input().split())\nif a > 0:\n print("Positive")\nelif b<0:\n if((b-a)%2 == 0):\n print("Negative")\n else:\n print("Positive")\nelse:\n print("Zero")']
['Runtime Error', 'Accepted']
['s671547226', 's504771153']
[9032.0, 9076.0]
[20.0, 29.0]
[187, 165]
p04033
u871890105
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a, b = map(int, input().split())\nif a <= 0 or b >= 0:\n print('Zero')\nelif a > 0:\n print('Positive')\nelif b < 0:\n if (b - a + 1) % 2 == 0:\n print('Positive')\n else:\n print('Negative')\n", "a, b = map(int, input().split())\nif a <= 0 or b >= 0:\n print('Zero')\nelif a > 0:\n print('Positive')\nelif b < 0:\n print('Negative')\n", "a, b = map(int, input().split())\nif a <= 0 and b >= 0:\n print('Zero')\nelif a > 0:\n print('Positive')\nelif b < 0:\n if (b - a + 1) % 2 == 0:\n print('Positive')\n else:\n print('Negative')\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s091161394', 's993851250', 's925357693']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[210, 140, 211]
p04033
u928784113
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
['a,b = str(int,input().split())\nS = a+b\nP = S.count("-")\nif P == 1:\n print("0")\nelif P == 2:\n print("Negative")\nelse:\n print("Positive")', 'a,b = map(str,input().split())\nS = a+b\nP = S.count("-")\nif P == 1:\n print("Zero")\nelif P == 2:\n if (int(b) - int(a)) % 2 ==0:\n print("Negative")\n else:\n print("Positive")\nelse:\n print("Positive")']
['Runtime Error', 'Accepted']
['s706600334', 's364034617']
[2940.0, 3060.0]
[18.0, 17.0]
[172, 239]
p04033
u942051624
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a,b=map(int,input().split())\n\nif a>0 and b>0:\n print('Positive')\n exit()\nelif a=0 or b=0:\n print('Zero')\n exit()\nelif a<0 and 0<b:\n if abs(a)%2==0:\n print('Positive')\n \texit()\n else:\n print('Negative')\n exit()\nelse:\n if abs(b-a)%2==0:\n print('Negative')\n exit()\n else:\n print('Positive')\n exit()\n\n ", "a,b=map(int,input().split())\n\nif a>0 and b>0:\n print('Positive')\n exit()\n\nelif a<=0 and 0<=b:\n print('Zero')\n exit()\nelse:\n if abs(b-a)%2==0:\n print('Negative')\n exit()\n else:\n print('Positive')\n exit()"]
['Runtime Error', 'Accepted']
['s665716431', 's139905808']
[8960.0, 9140.0]
[23.0, 29.0]
[330, 248]
p04033
u952708174
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a,b = [int(i) for i in input().split()]\nif a > 0:\n print('Positive')\nelif a = 0:\n print('Zero')\nelse:\n if b >= 0:\n print('Zero')\n elif b-a % 2 == 0:\n print('Negative')\n else:\n print('Positive')", "def a_range_product(A, B):\n ans = ''\n if A * B <= 0:\n ans = 'Zero' \n else:\n if A > 0:\n ans = 'Positive' \n else: \n ans = 'Negative' if abs(B - A + 1) % 2 == 1 else 'Positive'\n return ans\n\nA, B = [int(i) for i in input().split()]\nprint(a_range_product(A, B))"]
['Runtime Error', 'Accepted']
['s508976362', 's987218422']
[2940.0, 3060.0]
[17.0, 17.0]
[207, 404]
p04033
u966695411
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["#! /usr/bin/env python3\n\nA, B = map(int, input().split())\nif A < 0:\n if B < 0:\n print('Negative')\n else:\n print('Zero')\nelse:\n print('Positive ')", "#! /usr/bin/env python3\n\nA, B = map(int, input().split())\nif A < 0:\n if B < 0:\n print('Positive' if (abs(A)-abs(B))%2 else 'Negative')\n else:\n print('Zero')\nelse:\n print('Positive')"]
['Wrong Answer', 'Accepted']
['s379341430', 's017583232']
[3064.0, 3188.0]
[39.0, 48.0]
[168, 204]
p04033
u977389981
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["a, b = map(int, input().split())\n\nif a =< 0 and b >= 0:\n ans = 'Zero'\nelif a < 0 and b < 0:\n if (abs(a) - abs(b) + 1) % 2 == 0:\n ans = 'Positive'\n else:\n ans = 'Negative'\nelif a > 0 and b > 0:\n ans = 'Positive'\n \nprint(ans)", "a, b = map(int, input().split())\n\nif a <= 0 and b >= 0:\n ans = 'Zero'\nelif a < 0 and b < 0:\n if (abs(a) - abs(b) + 1) % 2 == 0:\n ans = 'Positive'\n else:\n ans = 'Negative'\nelif a > 0 and b > 0:\n ans = 'Positive'\n \nprint(ans)"]
['Runtime Error', 'Accepted']
['s386799538', 's610251522']
[2940.0, 3060.0]
[17.0, 18.0]
[252, 252]
p04033
u977605150
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
['a, b = map(int, input().split())\nc = b - a\nif a <= 0 <= b:\n print("Zero")\n \nelif a > 0:\n print("Positive")\n \nelif b < 0:a\n if c%2 == 1:\n print("Positive")\n else:\n print("Negative")', 'a, b = map(int, input().split())\nc = b - a\nif a <= 0 <= b:\n print("Zero")\n \nelif a > 0:\n print("Positive")\n \nelif b < 0:\n if c % 2 == 1:\n print("Positive")\n else:\n print("Negative")']
['Runtime Error', 'Accepted']
['s989601197', 's953452508']
[8996.0, 8976.0]
[21.0, 28.0]
[206, 207]
p04033
u995109095
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
["import sys\n# import numpy as np \n \ndef main():\n a, b = map(int, sys.stdin.read().split())\n \n if 0 < a:\n ans = 'Positive'\n elif 0 <= b:\n ans = 'Zero'\n else:\n if (b - a + 1) % 2 == 0:\n ans = 'Positive'\n else:\n ans = 'Negative'\n \n print(ans)\n \nif __name__ == '__main__':\n main(", "import sys\n# import numpy as np \n \ndef main():\n a, b = map(int, sys.stdin.read().split())\n \n if 0 < a:\n ans = 'Positive'\n elif 0 <= b:\n ans = 'Zero'\n else:\n if (b - a + 1) % 2 == 0:\n ans = 'Positive'\n else:\n ans = 'Negative'\n \n print(ans)\n \nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s807455549', 's951708579']
[2940.0, 2940.0]
[17.0, 17.0]
[345, 346]
p04033
u996542290
2,000
262,144
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
['a, b = map(int,input().split())\na=int(a)\nb=int(b)\nif a>0:\n print("positive")\nelif a ==0 or b==0:\n print(0)\nelif a <0 and b>0:\n print(0)\nelif (b-a)%2==0:\n print(\'negative\')\nelse:\n print("positibe")', 'a = input()\nb = input()\na=int(a)\nb=int(b)\nif a>0:\n print("positive")\nelif a ==0 or b==0:\n print(0)\nelif a <0 and b>0:\n print(0)\nelif (b-a)%2==0:\n print(\'negative\')\nelse:\n print("positibe")', 'a, b = map(int,input().split())\nif a<= 0 <=b:\n print("Zero") \nelif a > 0:\n print("Positive")\nelif a==b:\n print("Positive")\nelif (b-a)%2 == 0:\n print("Negative")\nelif (b-a)%2 == 1:\n print("Positive")']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s011028726', 's928279995', 's788147485']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 20.0]
[211, 203, 214]
p04034
u017050982
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N,M = map(int,input().rstrip().split(" "))\nans = [False for _ in range(N + 1)]\nballs = [1 for _ in range(N + 1)]\nans[1] = True\nfor i in range(M):\n q = list(map(int,input().rstrip().split(" ")))\n if ans[q[0]] == True:\n ans[q[1]] = True\n balls[q[0]] -= 1\n if balls[q[0]] == 0: ans[q[0]] = False\n balls[q[1]] += 1\nansi = 0\nprint(ans)\nfor i in range(N + 1):\n if ans[i]: ansi += 1\nprint(ansi)', 'N,M = map(int,input().rstrip().split(" "))\nans = [False for _ in range(N + 1)]\nballs = [1 for _ in range(N + 1)]\nans[1] = True\nfor i in range(M):\n q = list(map(int,input().rstrip().split(" ")))\n if ans[q[0]] == True:\n ans[q[1]] = True\n balls[q[0]] -= 1\n if balls[q[0]] == 0: ans[q[0]] = False\n balls[q[1]] += 1\nansi = 0\nfor i in range(N + 1):\n if ans[i]: ansi += 1\nprint(ansi)']
['Wrong Answer', 'Accepted']
['s595665489', 's354914051']
[6828.0, 4784.0]
[415.0, 421.0]
[396, 385]
p04034
u024442309
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['def main():\n N, M = map(int, input().split())\n l = []\n red = [1]\n for i in range(M):\n l.append(list(map(int, input().split())))\n for i in range(M):\n if l[i][0] in red:\n red.append(l[i][1])\n red.remove(l[i][0])\n print(len(set(red)))\n\nmain()\n', 'def main():\n N, M = map(int, input().split())\n l = []\n for i in range(M):\n l.append(list(map(int, input().split())))\n s = [1 for i in range(N)]\n r = [0 for i in range(N)]\n r[0] = 1\n for i in range(M):\n x = l[i][0] - 1\n y = l[i][1] - 1\n if r[x] == 1:\n if s[x] == 1:\n r[x] = 0\n r[y] = 1\n s[x] -= 1\n s[y] += 1\n print(sum(r))\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s683853869', 's963536892']
[27304.0, 29000.0]
[354.0, 367.0]
[294, 433]
p04034
u057993957
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = list(map(int, input().split()))\nxy = [list(map(int, input().split())) for i in range(m)]\n\nans = [1] * (n)\nans[0] = 1\nball = [0] * (n)\nball[0] = 1\nfor i in range(m):\n x, y = xy[i]\n ans[y-1] += 1\n ans[x-1] -= 1\n if ball[x-1]:\n ball[y-1] = 1\n if ans[x-1] == 0:\n ball[x-1] = 0\n \nprint(sum(cnt))', 'n, m = list(map(int, input().split()))\nxy = [list(map(int, input().split())) for i in range(m)]\n\nans = [1] * (n)\nans[0] = 1\nball = [0] * (n)\nball[0] = 1\nfor i in range(m):\n x, y = xy[i]\n ans[y-1] += 1\n ans[x-1] -= 1\n if ball[x-1]:\n ball[y-1] = 1\n if ans[x-1] == 0:\n ball[x-1] = 0\n \nprint(sum(ball))']
['Runtime Error', 'Accepted']
['s948665329', 's990107013']
[28964.0, 28836.0]
[417.0, 386.0]
[327, 328]
p04034
u075304271
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['import math\nimport collections\nimport fractions\nimport itertools\nimport functools\nimport operator\n\ndef solve():\n n, m = map(int, input().split())\n ball, can = [0]*n, [True]*n\n ball[0], can[0] = 1, True\n for _ in range(m):\n x, y = map(int, input().split())\n if can[x-1] == True:\n can[y-1] = True\n ball[x-1] -= 1\n ball[y-1] += 1\n if ball[x-1] == 0:\n can[x-1] = False\n print(can.count(True))\n return 0\n\nif __name__ == "__main__":\n solve()', 'import math\nimport collections\nimport fractions\nimport itertools\nimport functools\nimport operator\n\ndef solve():\n n, m = map(int, input().split())\n ball, can = [1]*n, [False]*n\n can[0] = True\n for _ in range(m):\n x, y = map(int, input().split())\n if can[x-1] == True:\n can[y-1] = True\n ball[x-1] -= 1\n ball[y-1] += 1\n if ball[x-1] == 0:\n can[x-1] = False\n print(can.count(True))\n return 0\n\nif __name__ == "__main__":\n solve()\n']
['Wrong Answer', 'Accepted']
['s799866019', 's752600513']
[11508.0, 11548.0]
[219.0, 216.0]
[514, 504]
p04034
u077291787
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['# AGC002B - Box and Ball\nimport sys\ninput = sys.stdin.readline\n\ndef main():\n N, M = tuple(map(int, input().split()))\n X = tuple(tuple(map(int, input().split())) for _ in range(M))\n R = [0] * (N + 1) # red ball may be in box i\n R[1] = 1\n C = [1] * (N + 1) # number of balls in box i (count)\n for x, y in X:\n R[y] = 1 if R[x] or R[y] else 0\n C[x] -= 1\n C[y] += 1\n R[x] = 0 if R[x] == 0 else R[x]\n ans = sum(R[1:])\n print(ans)\n\n\nif __name__ == "__main__":\n main()', '# AGC002B - Box and Ball\ndef main():\n N, M, *XY = map(int, open(0).read().split())\n R = [0] * (N + 1) # red ball may be in box i\n R[1] = 1\n C = [1] * (N + 1) # number of balls in box i (count)\n for x, y in zip(*[iter(XY)] * 2):\n R[y] = 1 if R[x] or R[y] else 0 # red ball may move from x to y\n C[x] -= 1\n C[y] += 1\n R[x] = 0 if C[x] == 0 else R[x] # no more ball in x\n ans = sum(R[1:])\n print(ans)\n\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s110678090', 's289395503']
[18848.0, 25116.0]
[193.0, 92.0]
[517, 490]
p04034
u163073599
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
[" n, l = (int(s) for s in input().strip().split(' '))\n an = []\nfor a in range(0,l):\n an.append(input().strip().split())\n\nbox=[[1,0] for i in range(n)]\nbox[0][1] = 1\nfor move in an:\n box[int(move[0])-1][0] -= 1\n box[int(move[1])-1][0]+=1\n if box[int(move[0])-1][1] == 1:\n box[int(move[1])-1][1]= 1\n if box[int(move[0])-1][0]==0:\n box[int(move[0])-1][1]=0\nprint(str(sum([s[1] for s in box])))", "n, l = (int(s) for s in input().strip().split(' '))\nan = []\nfor a in range(0,l):\n an.append(input().strip().split())\nbox=[[1,0] for i in range(n)]\nbox[0][1] = 1\nfor move in an:\n box[int(move[0])-1][0] -= 1\n box[int(move[1])-1][0]+=1\n if box[int(move[0])-1][1] == 1:\n box[int(move[1])-1][1]= 1\n if box[int(move[0])-1][0]==0:\n box[int(move[0])-1][1]=0\nprint(str(sum([s[1] for s in box])))"]
['Runtime Error', 'Accepted']
['s622761225', 's123081908']
[3064.0, 43316.0]
[41.0, 956.0]
[424, 415]
p04034
u163320134
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\narr=[list(map(int,input().split())) for _ in range(m)]\ncount=[1]*(n+1)\nflag=[False]*(n+1)\nflag[1]=True\nfor a,b in arr:\n count[b]+=1\n count[a]-=1\n if flag[a]==True:\n flag[b]==True\n if count[a]==0:\n flag[a]==False\nprint(flag.count(True))', 'n,m=map(int,input().split())\narr=[list(map(int,input().split())) for _ in range(m)]\ncount=[1]*(n+1)\nflag=[False]*(n+1)\nflag[1]=True\nfor a,b in arr:\n count[b]+=1\n count[a]-=1\n if flag[a]==True:\n flag[b]=True\n if count[a]==0:\n flag[a]=False\nprint(flag.count(True))']
['Wrong Answer', 'Accepted']
['s964644551', 's746315424']
[28964.0, 30884.0]
[360.0, 367.0]
[274, 272]
p04034
u183509493
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int,input().split())\nf = [False for _ in range(n)]\nf[0] = True\nfor i in range(m):\n x, y = map(int,input().split())\n f[y] = f[y] or f[x]\nprint(f.count(True))', 'n, m = map(int,input().split())\nf = [False for _ in range(n)]\nf[0] = True\nfor i in range(m):\n x, y = map(int,input().split())\n f[y - 1] = f[y - 1] or f[x - 1]\nprint(f.count(True))\n', 'n, m = map(int,input().split())\nf = [False for _ in range(n)]\nc = [1 for _ in range(n)]\nf[0] = True\nfor i in range(m):\n x, y = map(int,input().split())\n f[y - 1] = f[y - 1] or f[x - 1]\n c[y - 1] += 1\n c[x - 1] -= 1\n if c[x - 1] == 0:\n f[x - 1] = False\nans = 0\nfor i in range(n):\n if f[i] and c[i] > 0:\n ans += 1\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s365399235', 's415318318', 's217426383']
[3888.0, 3888.0, 4656.0]
[297.0, 302.0, 378.0]
[169, 182, 335]
p04034
u217627525
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\ncnt=[1]*n\nres=[0]*n\nres[0]=1\nfor i in range(m):\n x,y=map(int,input().split())\n if res[x-1]==1:\n res[y-1]=1\n if cnt[x-1]==1:\n res[x-1]=0\n cnt[x-1]-=1\n cnt[y-1]+=1\n print(cnt,res)\nprint(sum(res))', 'def main():\n n,m=map(int,input().split())\n cnt=[1]*n\n res=[0]*n\n res[0]=1\n for i in range(m):\n x,y=map(int,input().split())\n if res[x-1]==1:\n res[y-1]=1\n if cnt[x-1]==1:\n res[x-1]=0\n cnt[x-1]-=1\n cnt[y-1]+=1\n print(sum(res))\nif __name__=="__main__":\n main()']
['Wrong Answer', 'Accepted']
['s893985481', 's266180119']
[104580.0, 4596.0]
[2104.0, 327.0]
[262, 343]
p04034
u227082700
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\nx=[0]*n\nx[0]=1\nfor i in range(m):\n a,b=map(int,input().split())\n if x[a-1]==1:x[b-1]=1\nprint(sum(x))', 'n,m=map(int,input().split())\nans=[False]*n\nans[0]=True\nco=[1]*n\nfor i in range(m):\n x,y=map(int,input().split())\n ans[y-1]|=ans[x-1]\n co[x-1]-=1\n co[y-1]+=1\n if co[x-1]==0:ans[x-1]=False\nprint(ans.count(True))']
['Wrong Answer', 'Accepted']
['s152754058', 's868355904']
[3828.0, 10276.0]
[299.0, 233.0]
[131, 214]
p04034
u252828980
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m = map(int,input().split())\n\npossible = [0]*n\npossible[0] = 1\nkosuu = [1]*n\n\nfor i in range(m):\n a,b = map(int,input().split())\n a,b = a-1,b-1\n \n if kosuu[a] >= 2 and possible[a] ==1:\n possible[a] = 1 \n possible[b] = 1\n kosuu[a] -=1\n kosuu[b] +=1\n elif kosuu[a] ==1 and possible[a] ==1 : \n possible[a] = 0\n possible[b] = 1\n kosuu[a] = 0\n kosuu[b] +=1\n if kosuu[a] >= 2 and possible[a] ==0:\n possible[a] = 0\n possible[b] = 0\n kosuu[a] -=1\n kosuu[b] +=1\n elif kosuu[a] ==1 and possible[a] == : \n possible[a] = 0\n possible[b] = 0\n kosuu[a] = 0\n kosuu[b] +=1\n \nprint(sum(possible))', 'n,m = map(int,input().split())\npossible = [0]*n\nkosuu = [1]*n\npossible[0] = 1\n\nL = []\n\nif flag == False:\n print(1)\n exit()\nfor i in range(m):\n x,y = L[i][0],L[i][1]\n x,y = x-1,y-1\n if kosuu[x] >=2 and possible[x] == 1:\n possible[y] = 1\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 1:\n possible[x] = 0\n possible[y] = 1\n kosuu[x] = 0\n kosuu[y] +=1\n elif kosuu[x] >=2 and possible[x] == 0:\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 0:\n kosuu[x] = 0\n kosuu[y] +=1\nprint(sum(possible))', 'n,m = map(int,input().split())\npossible = [0]*n\nkosuu = [1]*n\npossible[0] = 1\nL = []\n\nfor i in range(m):\n x,y = map(int,input().split())\n L.append((x,y))\n\nfor i in range(idx,m):\n x,y = L[i][0],L[i][1]\n x,y = x-1,y-1\n if kosuu[x] >=2 and possible[x] == 1:\n possible[y] = 1\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 1:\n possible[x] = 0\n possible[y] = 1\n kosuu[x] = 0\n kosuu[y] +=1\n elif kosuu[x] >=2 and possible[x] == 0:\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 0:\n kosuu[x] = 0\n kosuu[y] +=1\n \nprint(sum(possible))', 'n,m = map(int,input().split())\npossible = [0]*n\nkosuu = [1]*n\npossible[0] = 1\nL = []\n\nfor i in range(m):\n x,y = map(int,input().split())\n L.append((x,y))\n\nfor i in range(m):\n x,y = L[i][0],L[i][1]\n x,y = x-1,y-1\n if kosuu[x] >=2 and possible[x] == 1:\n possible[y] = 1\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 1:\n possible[x] = 0\n possible[y] = 1\n kosuu[x] = 0\n kosuu[y] +=1\n elif kosuu[x] >=2 and possible[x] == 0:\n kosuu[x] -=1\n kosuu[y] +=1\n elif kosuu[x] == 1 and possible[x] == 0:\n kosuu[x] = 0\n kosuu[y] +=1\nprint(sum(possible))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s147892947', 's810754928', 's865096071', 's136109100']
[8912.0, 10540.0, 23920.0, 23808.0]
[28.0, 28.0, 210.0, 275.0]
[742, 628, 673, 660]
p04034
u276204978
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['def solve():\n N, M = map(int, input().split())\n \n num = []\n red = []\n for i in range(N+1):\n num.append(1)\n red.append(0)\n red[1] = 1\n \n for _ range(M):\n x, y = map(int, input().split())\n if red[x] == 1:\n red[y] = 1\n num[x] -= 1\n num[y] += 1\n if num[x] == 0:\n red[x] = 0\n \n return sum(red)\n\nprint(solve())', 'def solve():\n N, M = map(int, input().split())\n \n num = []\n red = []\n for i in range(N+1):\n num.append(1)\n red.append(0)\n red[1] = 1\n \n for _ in range(M):\n x, y = map(int, input().split())\n if red[x] == 1:\n red[y] = 1\n num[x] -= 1\n num[y] += 1\n if num[x] == 0:\n red[x] = 0\n \n return sum(red)\n\nprint(solve())']
['Runtime Error', 'Accepted']
['s236811391', 's167015103']
[2940.0, 4764.0]
[17.0, 320.0]
[405, 408]
p04034
u309141201
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int, input().split())\nboxes = [[0, 1] for _ in range(n)]\nboxes[0][0] = 1\nfor _ in range(m):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n boxes[x][1] -= 1\n boxes[y][1] += 1\n if boxes[x][0] == 1:\n boxes[y][0] = 1\n else:\n if boxes[y][0] == 1:\n continue\n else:\n boxes[y][0] = 0 \n if boxes[x][1] == 0:\n boxes[x][0] = -1\nans = 0\nfor a, b in boxes:\n # print(a, b)\n if a:\n ans += 1\n# print(boxes)\nprint(ans)\n', 'n, m = map(int, input().split())\nboxes = [[0, 1] for _ in range(n)]\nboxes[0][0] = 1\nfor _ in range(m):\n x, y = map(int, input().split())\n x -= 1\n y -= 1\n boxes[x][1] -= 1\n boxes[y][1] += 1\n if boxes[x][0] == 1:\n boxes[y][0] = 1\n else:\n if boxes[y][0] == 1:\n continue\n else:\n boxes[y][0] = 0 \n if boxes[x][1] == 0:\n boxes[x][0] = -1\nans = 0\nfor a, b in boxes:\n # print(a, b)\n if a > 0:\n ans += 1\n# print(boxes)\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s697067774', 's539396948']
[13172.0, 13172.0]
[412.0, 418.0]
[505, 509]
p04034
u314089899
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N,M = map(int, input().split())\n\nballs_in_box = [0] + [1 for _ in range(1,N+1)]\nred_ball_containable_box = set()\nred_ball_containable_box.add(y)\n\nfor i in range(M):\n x,y = map(int, input().split())\n if x in red_ball_containable_box:\n balls_in_box[x] -= 1\n balls_in_box[y] += 1\n red_ball_containable_box.add(y)\n if balls_in_box[x] == 0: \n red_ball_containable_box.remove(x)\n else:\n balls_in_box[x] -= 1\n balls_in_box[y] += 1\n\nprint(len(red_ball_containable_box))', 'N,M = map(int, input().split())\n\nballs_in_box = [0] + [1 for _ in range(1,N+1)]\nred_ball_containable_box = set()\nred_ball_containable_box.add(1)\n\nfor i in range(M):\n x,y = map(int, input().split())\n if x in red_ball_containable_box:\n balls_in_box[x] -= 1\n balls_in_box[y] += 1\n red_ball_containable_box.add(y)\n if balls_in_box[x] == 0: \n red_ball_containable_box.remove(x)\n else:\n balls_in_box[x] -= 1\n balls_in_box[y] += 1\n\nprint(len(red_ball_containable_box))']
['Runtime Error', 'Accepted']
['s455578513', 's157863624']
[4656.0, 13344.0]
[22.0, 358.0]
[611, 611]
p04034
u315485238
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N,M = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in range(M)]\n\nred = set([1])\nn_ball = [1]*(N+1)\n\nfor x,y in XY:\n n_ball[x] -= 1\n n_ball[y] += 1\n if x in red:\n red.add(y)\n if n_ball[x]==0:\n red.remove(x)\n print(red)\n print(n_ball)\nprint(len(red))', 'N,M = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in range(M)]\n\nred = set([1])\nn_ball = [1]*(N+1)\n\nfor x,y in XY:\n n_ball[x] -= 1\n n_ball[y] += 1\n if x in red:\n red.add(y)\n if n_ball[x]==0:\n red.remove(x)\nprint(len(red))']
['Wrong Answer', 'Accepted']
['s670974893', 's146834737']
[111224.0, 34332.0]
[2105.0, 376.0]
[295, 266]
p04034
u363074342
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int,input().split())\nbox = [[1,0] for i in range(n)]\nbox[0][1] = 1\nans = 1\n\nfor i in range(m):\n x, y = map(int,input().split())\n if box[x-1][0] == 0:\n continue\n box[x-1][0] -= 1\n box[y-1][0] += 1\n if box[x-1][1] == 1:\n if box[y-1][1] == 0:\n box[y-1][1] = 1\n ans += 1\n if box[x-1][0] == 0:\n ans -= 1\n\nkotae = 0\nfor i in range(n):\n kotae += box[i][1]\nprint(kotae)\n\n\n', 'n, m = map(int,input().split())\nbox = [[1,0] for i in range(n)]\nbox[0][1] = 1\nans = 1\n\nfor i in range(m):\n x, y = map(int,input().split())\n if box[x-1][0] == 0:\n continue\n box[x-1][0] -= 1\n box[y-1][0] += 1\n if box[x-1][1] == 1:\n if box[y-1][1] == 0:\n box[y-1][1] = 1\n ans += 1\n if box[x-1][0] == 0:\n box[x-1][1] = 0\n ans -= 1\n\n\nprint(ans)\n\n\n']
['Wrong Answer', 'Accepted']
['s930517456', 's861510457']
[13172.0, 13172.0]
[429.0, 409.0]
[472, 447]
p04034
u372320597
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['import numpy as np\n\nn, m = map(int, input().split())\npossibility = [0 for _ in range(n)]\nball = [1 for _ in range(n)]\npossibility[0] = 1\nfor i in range(m):\n x, y = map(int, input().split())\n if ball[x-1] != 0:\n possibility[y-1] = 1\n ball[x-1] -= 1\n ball[y-1] += 1\nprint(np.sum(np.array(possibility) > 0))', 'import numpy as np\nimport math\n\nn, m = map(int, input().split())\nprobability = [0 for _ in range(n)]\nball = [1 for _ in range(n)]\nprobability[0] = 1\nfor i in range(m):\n x, y = map(int, input().split())\n prob = math.ceil(probability[x-1])\n probability[x-1] = prob * (ball[x-1] - 1) / ball[x-1]\n probability[y-1] += prob / ball[x-1]\n ball[x-1] -= 1\n ball[y-1] += 1\nprint(np.sum(np.array(probability) > 0))\n']
['Wrong Answer', 'Accepted']
['s805697989', 's899556513']
[15072.0, 17060.0]
[491.0, 604.0]
[323, 422]
p04034
u377989038
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['import sys\ninput = sys.stdin.buffer.readline\n\nn, m = map(int, input().split())\nb = [False] * (n + 1)\nc = [1] * (n + 1)\nfor i in range(m):\n x, y = map(int, input().split())\n c[x] -= 1\n c[y] += 1\n if b[x]:\n b[y] = True\n if c[x] == 0:\n b[x] = False\nprint(sum(b))', 'import sys\ninput = sys.stdin.buffer.readline\n\nn, m = map(int, input().split())\nb = [False, True] + [False] * (n - 1)\nc = [1] * (n + 1)\nfor i in range(m):\n x, y = map(int, input().split())\n c[x] -= 1\n c[y] += 1\n if b[x]:\n b[y] = True\n if c[x] == 0:\n b[x] = False\nprint(sum(b))']
['Wrong Answer', 'Accepted']
['s524507643', 's675381699']
[4596.0, 4596.0]
[163.0, 170.0]
[288, 304]
p04034
u405256066
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['from sys import stdin\nN,M = [int(x) for x in stdin.readline().rstrip().split()]\nbox = [1]*(N+1)\nflag = False\nn1_pass = {1}\nfor _ in range(M):\n x,y = [int(x) for x in stdin.readline().rstrip().split()]\n box[x] -= 1\n box[y] += 1\n if box[x] == 0:\n n1_pass = n1_pass - {x}\n if (x in n1_pass):\n n1_pass.add(y)\nprint(len(n1_pass))', 'from sys import stdin\nN,M = [int(x) for x in stdin.readline().rstrip().split()]\nbox = [1]*(N+1)\nflag = False\nn1_pass = set()\nn1_now = 0\nfor _ in range(M):\n x,y = [int(x) for x in stdin.readline().rstrip().split()]\n box[x] -= 1\n box[y] += 1\n if box[x] == 0:\n n1_pass.remove(x)\n if x == 1 and not flag:\n n1_pass.add(y)\n n1_now = y\n flag = True\n if flag and x == n1_now:\n n1_pass.add(y)\n n1_now = y\nans = 0\nfor i in n1_pass:\n if box[i] > 0:\n ans += 1\nprint(ans)', 'from sys import stdin\nN,M = [int(x) for x in stdin.readline().rstrip().split()]\nbox = [1]*(N+1)\nflag = False\nn1_pass = {1}\nfor _ in range(M):\n x,y = [int(x) for x in stdin.readline().rstrip().split()]\n box[x] -= 1\n box[y] += 1\n if box[x] == 0:\n n1_pass = n1_pass - {x}\n if (x in n1_pass):\n n1_pass.add(y)\nans = 0\nfor i in n1_pass:\n if box[i] > 0:\n ans += 1\nprint(ans)', 'from sys import stdin\nN,M = [int(x) for x in stdin.readline().rstrip().split()]\nbox = [1]*(N+1)\nred = [False]*(N+1)\nred[1] = True\nfor _ in range(M):\n x,y = [int(x) for x in stdin.readline().rstrip().split()]\n if red[x]:\n red[y] = True\n box[x] -= 1\n box[y] += 1\n if box[x] == 0:\n red[x] = False\nans = 0\nfor i in red:\n if i:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s063722201', 's118853308', 's328120763', 's777313130']
[7020.0, 3828.0, 7020.0, 4596.0]
[251.0, 18.0, 240.0, 211.0]
[353, 528, 406, 382]
p04034
u426108351
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N, M = map(int, input().split())\nred = [False for i in range(N+1)]\nred[1] = True\nbox = [1 for i in range(N+1)]\n\nfor i in range(M):\n x, y = map(int, input().split())\n if red[x]:\n red[y] = True\n box[x] -= 1\n box[y] += 1\n if box[i] == 0:\n red[x] = False\n\nans = 0\nfor i in range(1, N+1):\n if red[i] and box[i] > 0:\n ans += 1\nprint(ans)\n', 'N, M = map(int, input().split())\nred = [False for i in range(N+1)]\nred[1] = True\nbox = [1 for i in range(N+1)]\n\nfor i in range(M):\n x, y = map(int, input().split())\n if red[x]:\n red[y] = True\n box[x] -= 1\n box[y] += 1\n if box[x] == 0:\n red[x] = False\n\nans = 0\nfor i in range(1, N+1):\n if red[i] and box[i] > 0:\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s187588700', 's462548032']
[4760.0, 4760.0]
[348.0, 356.0]
[371, 370]
p04034
u436982376
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int,input().split())\nb_list = []\n\nfor i in range(m):\n x = []\n x = list(map(int,input().split()))\n b_list.append(x)\n\nans_list = [0 for i in range(10**5)]\nans_list[0] = 1\nball_list = [1 for i in range(10**5)]\nprint(ball_list[0])\n\nfor tmp in b_list:\n x, y = tmp[0], tmp[1]\n print(x, y)\n if ans_list[x-1] == 1 and ans_list[y-1] == 0:\n ans_list[y-1] += 1\n ball_list[y-1] += 1\n ball_list[x-1] -= 1\n if ball_list[x-1] == 0:\n ans_list[x-1] = 0\n\nans = 0\n\nfor i in ans_list:\n if i == 1:\n ans += 1\n\nprint(ans)\n', 'n, m = map(int,input().split())\nb_list = []\n\nfor i in range(m):\n x = []\n x = list(map(int,input().split()))\n b_list.append(x)\n\nans_list = [0 for i in range(10**5)]\nans_list[0] = 1\nball_list = [1 for i in range(10**5)]\n\nfor tmp in b_list:\n x, y = tmp[0], tmp[1]\n if ans_list[x-1] == 1 and ans_list[y-1] == 0:\n ans_list[y-1] += 1\n ball_list[y-1] += 1\n ball_list[x-1] -= 1\n if ball_list[x-1] == 0:\n ans_list[x-1] = 0\n\nans = 0\n\nfor i in ans_list:\n if i == 1:\n ans += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s947700489', 's079345852']
[28860.0, 28832.0]
[355.0, 299.0]
[561, 525]
p04034
u463775490
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int, input().split())\nbox = [0] * (n+1)\nbox[1] = 1\nfor i in range(m):\n x, y = map(int, input().split())\n if box[x]:\n box[y] = 1\nprint(sum(box))', 'n, m = map(int, input().split())\nbox = [[0, 1] for _ in range(n+1)]\nbox[0][1] = 0\nbox[1][0] = 1\nfor i in range(m):\n x, y = map(int, input().split())\n if box[x][0]:\n box[y][0] = 1\n box[x][1] -= 1\n box[y][1] += 1\n if box[x][1] == 0:\n box[x][0] = 0\nprint(sum(box[x][0] for x in range(1,n+1)))']
['Wrong Answer', 'Accepted']
['s797701429', 's342365559']
[3828.0, 13172.0]
[284.0, 375.0]
[159, 300]
p04034
u518042385
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\nl=[0 for i in range(n)]\nl[0]=1\nlc=[1 for i in range(n)]\nfor i in range(m):\n a,b=map(int,input().split())\n if l[a-1]==1 and lc[a-1]==1:\n lc[a-1]=0\n l[a-1]=0\n l[b-1]=1\n lc[b-1]+=1\n elif l[a-1]==1:\n lc[a-1]-=1\n l[b-1]=1\n lc[b-1]+=1\n else:\n lc[a-1]-=1\n lc[b-1]+=1\nans=0\nfor i in range(n):\n if l[i]==1 and lc[i]>0:\n ans+-1\nprint(ans)\n ', 'n,m=map(int,input().split())\nl=[0 for i in range(n)]\nl[0]=1\nlc=[1 for i in range(n)]\nfor i in range(m):\n a,b=map(int,input().split())\n if l[a-1]==1 and lc[a-1]==1:\n lc[a-1]=0\n l[a-1]=0\n l[b-1]=1\n lc[b-1]+=1\n elif l[a-1]==1:\n lc[a-1]-=1\n l[b-1]=1\n lc[b-1]+=1\n else:\n lc[a-1]-=1\n lc[b-1]+=1\nans=0\nfor i in range(n):\n if l[i]==1 and lc[i]>0:\n ans+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s011310592', 's437633253']
[4784.0, 4788.0]
[374.0, 377.0]
[399, 392]
p04034
u562016607
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N,M=map(int,input().split())\nx=[0 for i in range(M)]\ny=[0 for i in range(M)]\nfor i in range(M):\n x[i],y[i]=map(int,input().split())\n x[i]-=1\n y[i]-=1\na=[0 for i in range(N)]\na[0]=N**N\nc=[0 for i in range(N)]\nc[0]=1\nb=[1 for i in range(N)]\nfor i in range(M):\n b[x[i]]-=1\n b[y[i]]+=1\n t=a[x[i]]\n a[x[i]]-=t/(b[x[i]]+1)\n a[y[i]]+=t/(b[x[i]]+1)\nprint(sum(c))\n', 'N,M=map(int,input().split())\nx=[0 for i in range(M)]\ny=[0 for i in range(M)]\nfor i in range(M):\n x[i],y[i]=map(int,input().split())\n x[i]-=1\n y[i]-=1\na=[0 for i in range(N)]\na[0]=N\nb=[1 for i in range(N)]\nfor i in range(M):\n b[x[i]]-=1\n b[y[i]]+=1\n t=a[x[i]]\n a[x[i]]-=N*t/(b[x[i]]+1)\n a[y[i]]+=N*t/(b[x[i]]+1)\nn=0\nfor i in range(N):\n if a[i]!=0:\n n+=1\nprint(n)\n', 'N,M=map(int,input().split())\nx=[0 for i in range(M)]\ny=[0 for i in range(M)]\nfor i in range(M):\n x[i],y[i]=map(int,input().split())\n x[i]-=1\n y[i]-=1\na=[0 for i in range(N)]\na[0]=1\nb=[1 for i in range(N)]\nfor i in range(M):\n b[x[i]]-=1\n b[y[i]]+=1\n if a[x[i]]==1:\n a[y[i]]=1\n if b[x[i]]==0:\n a[x[i]]=0\nprint(sum(a))\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s062152863', 's547516957', 's099143877']
[14400.0, 14888.0, 12584.0]
[424.0, 488.0, 382.0]
[379, 396, 351]
p04034
u574050882
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['def main():\n t = input().split(" ")\n N, M = int(t[0]), int(t[1])\n x = [1]\n for i in range(M):\n t = input().split(" ")\n fr, to = int(t[0]), int(t[1])\n if fr in x:\n x.append(to)\n print(len(x))\n \nmain()', 'def main():\n t = input().split(" ")\n N, M = int(t[0]), int(t[1])\n x = set([0])\n n = [1]*N\n for i in range(M):\n t = input().split(" ")\n fr, to = int(t[0])-1, int(t[1])-1\n if fr in x:\n x.add(to)\n n[fr] -= 1\n n[to] += 1\n if (fr in x) and n[fr] == 0:\n x.remove(fr)\n print(len(x))\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s259376634', 's642698994']
[5012.0, 12652.0]
[2104.0, 312.0]
[219, 320]
p04034
u598229387
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\nprint(n,m)\n\nli=[1]*(n+1)\n\nse=set()\nse.add(1)\nfor i in range(m):\n\tx,y=map(int,input().split())\n\tli[x]-=1\n\tli[y]+=1\n\tprint(li)\n\tif x in se:\n\t\tse.add(y)\n\tif li[x]==0:\n\t\tse.remove(x)\nprint(len(se))', 'n,m=map(int,input().split())\n\nli=[1]*(n+1)\n\nse=set()\nse.add(1)\nfor i in range(m):\n\tx,y=map(int,input().split())\n\tli[x]-=1\n\tli[y]+=1\n\tprint(li)\n\tif x in se:\n\t\tse.add(y)\n\t\tif li[x]==0:\n\t\t\tse.remove(x)\nprint(len(se))', 'n,m=map(int,input().split())\n\nli=[1]*(n+1)\n\nse=set()\nse.add(1)\nfor i in range(m):\n\tx,y=map(int,input().split())\n\tli[x]-=1\n\tli[y]+=1\n\tprint(li)\n\tif x in se:\n\t\tse.add(y)\n\tif li[x]==0:\n\t\tse.remove(x)\nprint(len(se))', 'n,m=map(int,input().split())\n\nli=[1]*(n+1)\n\nse=set()\nse.add(1)\nfor i in range(m):\n\tx,y=map(int,input().split())\n\tli[x]-=1\n\tli[y]+=1\n\tif x in se:\n\t\tse.add(y)\n\t\tif li[x]==0:\n\t\t\tse.remove(x)\nprint(len(se))']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s379349310', 's388439322', 's789470210', 's222604433']
[98412.0, 100780.0, 100780.0, 12652.0]
[2104.0, 2107.0, 2104.0, 359.0]
[223, 214, 212, 203]
p04034
u652081898
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int, input().split())\nstack = [1]*n\np = [False]*n\np[0] = True\n\nfor i in range(m):\n x, y = map(int, input().split())\n stack[x-1] -= 1\n stack[y-1] += 1\n p[y-1] = p[x-1] or p[y-1]\n if stack[0] == 0:\n p[0] = False\n\nfor i in p:\n if i:\n ans += 1\nprint(ans)', 'n, m = map(int, input().split())\nstack = [1]*n\np = [False]*n\np[0] = True\n\nfor i in range(m):\n x, y = map(int, input().split())\n stack[x-1] -= 1\n stack[y-1] += 1\n p[y-1] = p[x-1] or p[y-1]\n if stack[x-1] == 0:\n p[x-1] = False\n\nans = 0\nfor i in p:\n if i:\n ans += 1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s237418468', 's191529425']
[4596.0, 4596.0]
[352.0, 357.0]
[293, 306]
p04034
u667024514
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m = map(int,input().split())\nlis = [[1,0] for i in range(n)]\nlis[0][1] = 1\nans = 1\nfor i in range(m):\n a,b = map(int,input().split())\n if lis[a-1][1] == 1:\n lis[b-1][1] = 1\n lis[b-1][0] += 1\n lis[a-1][0] -= 1\n if lis[a-1][0] == 0:\n lis[a-1][1] = 0\nfor i in range(n):\n if lis[i][1] == 1:\n ans += 1\nprint(ans)\n', 'n,m = map(int,input().split())\nlis = [[1,0] for i in range(n)]\nlis[0][1] = 1\nfor i in range(m):\n a,b = map(int,input().split())\n if lis[a-1][1] == 1:\n lis[b-1][1] = 1\n if lis[a-1][0] == 1:\n lis[a-1][1] = 0\n lis[a-1][0] -= 1\n lis[b-1][0] += 1\nans = 0\nfor i in range(n):\n if lis[i][1] == 1:ans += 1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s888126241', 's047470081']
[13172.0, 13172.0]
[404.0, 398.0]
[325, 324]
p04034
u745087332
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
["# coding:utf-8\n\nINF = float('inf')\n\n\ndef inpl(): return list(map(int, input().split()))\n\n\nN, M = inpl()\nmove = [inpl() for _ in range(M)]\n\nans = [0 for _ in range(N)]\nans[0] = 1\nbox = [1 for _ in range(N)]\n# print(ans, box)\nfor i in range(M):\n x, y = move[i]\n box[x - 1] -= 1\n box[y - 1] += 1\n if ans[x - 1]:\n ans[y - 1] = 1\n if box[x - 1] == 0:\n ans[x - 1] = 0\n # print(ans, box)\n\n\nprint(sum(ans), ans)", "# coding:utf-8\n\nimport sys\n\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef II(): return int(sys.stdin.readline())\ndef SI(): return input()\n\n\ndef main():\n n, m = LI()\n\n B = [1] * n\n R = [0] * n\n R[0] = 1\n\n for _ in range(m):\n x, y = LI_()\n\n B[x] -= 1\n B[y] += 1\n\n \n if R[x]:\n R[y] = 1\n\n \n if not B[x]:\n R[x] = 0\n\n return sum(R)\n\n\nprint(main())\n"]
['Wrong Answer', 'Accepted']
['s892702230', 's981903457']
[29920.0, 4596.0]
[430.0, 200.0]
[443, 775]
p04034
u785989355
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['\nN,M = list(map(int,input().split()))\n\nball_list = [1 for i in range(N)]\nflag_list = [False for i in range(N)]\nflag_list[0] = True\n\nfor i in range(M):\n x,y = list(map(int,input().split()))\n if flag_list[x-1]:\n flag_list[y-1]=True\n if ball_list[x-1]==1:\n flag_list[x-1]=False\n ball_list[x-1]-=1\n ball_list[y-1]+=1\ncount=0 \nfor i in range(M):\n if flag_list[i]:\n count+=1\n\nprint(count)', 'N,M = list(map(int,input().split()))\n\nball_list = [1 for i in range(N)]\nflag_list = [False for i in range(N)]\nflag_list[0] = True\n\nfor i in range(M):\n x,y = list(map(int,input().split()))\n if flag_list[x-1]:\n flag_list[y-1]=True\n if ball_list[x-1]==1:\n flag_list[x-1]=False\n ball_list[x-1]-=1\n ball_list[y-1]+=1\ncount=0 \nfor i in range(N):\n if flag_list[i]:\n count+=1\n\nprint(count)']
['Runtime Error', 'Accepted']
['s583870527', 's845288634']
[4760.0, 4760.0]
[404.0, 400.0]
[432, 431]
p04034
u796424048
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N,M = list(map(int,input().split()))\nx = []\ny = []\nred = [0]\nmas = [1 for i in range(N)]\n\nfor i in range(M):\n x,y = map(int,input().split())\n x -= 1\n y -= 1\n mas[x] -= 1\n mas[y] += 1\n if x in red:\n if x not in red:\n red.append(y)\n if mas[x] == 0:\n red.remove(x)\n\nprint(len(red))\n\n \n \n', 'N,M = list(map(int,input().split()))\nx = []\ny = []\n\nfor i in range(M):\n u,v = map(int,input().split())\n x.append(u-1)\n y.append(v-1)\n \nred = [0]\nmas = [1 for i in range(N)]\n\nfor j in range(M):\n mas[x[j]] -= 1\n mas[y[j]] += 1\n if x[j] in red and x[j] not in red:\n red.append(y[j])\n if mas[x[j]] == 0:\n red.remove(x[j])\n\nprint(len(red))\n\n ', 'N,M = list(map(int,input().split()))\nx = []\ny = []\n\nfor i in range(M):\n u,v = map(int,input().split())\n x.append(u-1)\n y.append(v-1)\n \nred = [0]\nmas = [1 for i in range(N)]\n\nfor j in range(M):\n mas[x[j]] -= 1\n mas[y[j]] += 1\n if x[j] in red:\n if x[j] not in red:\n red.append(y[j])\n if mas[x[j]] == 0:\n red.remove(x[j])\n\nprint(len(red))\n', 'N,M = list(map(int,input().split()))\nx = []\ny = []\n\nfor i in range(M):\n u,v = map(int,input().split())\n x.append(u-1)\n y.append(v-1)\n \nred = [0]\nmas = [1 for i in range(N)]\n\nfor j in range(M):\n if x[j] == set(red):\n mas[y[j]] += 1\n mas[x[j]] -= 1\n red.append(y[j])\n if mas[x[j]] == 0:\n red.remove(x[j])\n\nprint(len(red))', 'N,M = list(map(int,input().split()))\nx = []\ny = []\nred = [0 for i in range(N)]\nmas = [1 for i in range(N)]\nred[0] = 1\n\nfor i in range(M):\n x,y = map(int,input().split())\n x -= 1\n y -= 1\n mas[x] -= 1\n mas[y] += 1\n if red[x] == 1:\n if red[y] == 0:\n red[y] = 1\n if mas[x] == 0:\n red[x] = 0\n\nprint(sum(red))\n\n \n ']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s138550507', 's475819932', 's688298997', 's711306799', 's798953838']
[3888.0, 11768.0, 11768.0, 11776.0, 4656.0]
[335.0, 337.0, 341.0, 330.0, 354.0]
[348, 390, 393, 373, 372]
p04034
u801049006
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n, m = map(int, input().split())\n\ns = [0] * n\ns[0] = 1\nb = [1] * n\nfor i in range(m):\n x, y = map(int, input().split())\n \n s[y-1] = s[x-1]\n s[x-1] = int(b[x-1] == 1)\n\n b[x-1] -= 1\n b[y-1] += 1\n\nans = 0\nfor i in range(n):\n if s[i] and b[i]:\n ans += 1\n\nprint(ans)\n', 'n, m = map(int, input().split())\n\ns = [0] * n\ns[0] = 1\nb = [1] * n\nfor i in range(m):\n x, y = map(int, input().split())\n if s[x-1]:\n s[y-1] = 1\n if b[x-1] == 1:\n s[x-1] = 0\n b[x-1] -= 1\n b[y-1] += 1\n\nans = 0\nfor i in range(n):\n if s[i] and b[i]:\n ans += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s303333352', 's136534641']
[4596.0, 4596.0]
[381.0, 366.0]
[290, 307]
p04034
u844789719
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['N, M = [int(_) for _ in input().split()]\nXY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]\n\nred = [False] * M\nred[0] = True\nnum = [1] * M\n\nfor x, y in XY:\n num[x] -= 1\n num[y] += 1\n if red[x] == True:\n red[y] = True\n if num[x] == 0:\n red[x] = False\nprint(sum(red))\n\n\n', 'N, M = [int(_) for _ in input().split()]\nXY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]\n\nred = [False] * N\nred[0] = True\nnum = [1] * N\n\nfor x, y in XY:\n num[x] -= 1\n num[y] += 1\n if red[x] == True:\n red[y] = True\n if num[x] == 0:\n red[x] = False\nprint(sum(red))\n\n\n']
['Runtime Error', 'Accepted']
['s500273099', 's857066600']
[24740.0, 22692.0]
[374.0, 365.0]
[375, 375]
p04034
u896741788
2,000
262,144
We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball. Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i. Find the number of boxes that may contain the red ball after all operations are performed.
['n,m=map(int,input().split())\naru=1\na=[1]*n\nans=set([1])\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if aru==x:\n aru=y\n if a[x-1]!=0:\n ans.add(x)\n elif a[x-1]==0 and x in ans:ans.remove(x)\nprint(len(ans))', 'n,m=map(int,input().split())\na=[1]*n\nans=set([1])\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if x in ans:\n ans.add(y)\n if a[x-1]==0:ans.rempve(x)\nprint(len(ans))', 'n,m=map(int,input().split())\naru=1\na=[1]*n\nans=set()\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if aru==x:\n aru=y\n if a[x-1]!=0:\n ans.add(x)\n else:ans.remove(x)\nprint(len(ans))', 'n,m=map(int,input().split())\naru=1\na=[1]*n\nans=set()\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if aru==x:\n aru=y\n if a[x-1]!=0:\n ans.add(x)\nprint(len(ans))', 'n,m=map(int,input().split())\naru=1\na=[1]*n\nans=set([1])\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if aru==x:\n aru=y\n if a[x-1]!=0:\n ans.add(x)\n else:ans.remove(x)\nprint(len(ans))', 'n,m=map(int,input().split())\naru=1\na=[1]*n\nans=set([1])\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if aru==x:\n aru=y\n if a[x-1]!=0:\n ans.add(x)\n elif x in ans:ans.remove(x)\nprint(len(ans))', 'n,m=map(int,input().split())\na=[1]*n\nans=set([1])\nfor i in range(m):\n x,y=map(int,input().split())\n if a[x-1]==0:continue\n else:\n a[x-1]-=1\n a[y-1]+=1\n if x in ans:\n ans.add(y)\n if a[x-1]==0:ans.remove(x)\nprint(len(ans))']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s096431948', 's162049048', 's428685353', 's734174530', 's767844490', 's947422128', 's612260946']
[12776.0, 7020.0, 3828.0, 12648.0, 12776.0, 12776.0, 12652.0]
[370.0, 343.0, 342.0, 378.0, 365.0, 390.0, 379.0]
[295, 242, 269, 244, 272, 281, 242]
p04047
u016567570
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['#-*- coding: utf-8 -*-\nN = int(input())\nL_list = [int(input()) for n in range(2N)]\n\nL_list.sort()\nprint(sum(L_list[1::2]))', '#-*- coding: utf-8 -*-\nN = int(input())\nL_list = [int(input()) for n in range(2N)]\n\nL_list.sort()\nprint(sum(L_list[::2]))', '#-*- coding: utf-8 -*-\nN = int(input())\nL_list = list(map(int, input().split()))\nL_list.sort()\nprint(sum(L_list[::2]))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s617248161', 's822001572', 's058572448']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[122, 121, 118]
p04047
u016844138
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\narr=list(map(int,input().split()))\narr=arr.sort()\ns=0\nfor i in range(0,(2*n)-1,2):\n s+=arr[i]\nprint(s)', 'n=int(input())\narr=list(map(int,input().split()))\narr.sort()\ns=0\nfor i in range(0,(2*n)-1,2):\n s+=arr[i]\nprint(s)']
['Runtime Error', 'Accepted']
['s525380249', 's162850141']
[8960.0, 9036.0]
[24.0, 29.0]
[118, 114]
p04047
u023229441
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input());print(sum(sorted(list(map(int,input().split())))[::2]))\nprint("REIWA!")', 'n=int(input());print(sum(sorted(list(map(int,input().split())))[::2]))\nprint("RE WA?"', 'n=int(input())\nA=sorted(list(map(int,input().split())))\nprint(sum(A[::2]))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s348894653', 's493625966', 's649697092']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[86, 85, 74]
p04047
u030726788
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=list(map(int,input().split()))\nl.sort()\ns=0\nfor i in range(n//2):\n s+=l[i]\nprint(s)', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\ns=0\nfor i in range(n):\n s+=l[i]\nprint(s)\n', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\ns=0\nfor i in range(2*n)[::2]:\n s+=l[i]\nprint(s)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s598814486', 's740268969', 's886630307']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[101, 99, 106]
p04047
u033524082
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=0\nfor i in range(0,n/2,2):\n ans+=l[i]\nprint(ans)', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=0\nfor i in range(0,n/2,2):\n ans+=l[i]\nprint(ans)n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=0\nfor i in range([0,]n[,2]):\n ans+=l[i]\nprint(ans)', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=0\ni=0\nwhile i<n*2-1:\n ans+=l[i]\n i+=2\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s040201729', 's836937692', 's516892879']
[2940.0, 2940.0, 3060.0]
[18.0, 18.0, 18.0]
[112, 226, 115]
p04047
u075012704
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
["from collections import deque\n\nN, K = map(int, input().split())\nT = [[] for i in range(N)]\nE = []\nfor i in range(N-1):\n a, b = map(int, input().split())\n a, b = a-1, b-1\n T[a].append(b)\n T[b].append(a)\n E.append((a, b))\n\n\ndef bfs(n):\n visited = [False] * N\n dist = [0] * N\n queue = deque([n])\n while queue:\n node = queue.pop()\n if visited[node]:\n continue\n visited[node] = True\n for n in T[node]:\n if not visited[n]:\n dist[n] = dist[node] + 1\n queue.appendleft(n)\n return dist\n\n\ndist = []\nfor i in range(N):\n dist.append(bfs(i))\n\nans = float('inf')\nif K % 2 == 0:\n \n for i in range(N):\n ans = min(ans, len([d for d in dist[i] if d > K / 2]))\nelse:\n \n for a, b in E:\n adist = [(1 if min(d1, d2) > (K-1) / 2 else 0) for d1, d2 in zip(dist[a], dist[b])]\n ans = min(ans, sum(adist))\n\nprint(ans)\n", 'N = int(input())\nL = sorted(list(map(int, input().split())))\nprint(sum(L[::2]))']
['Runtime Error', 'Accepted']
['s439685767', 's384815406']
[3316.0, 2940.0]
[23.0, 17.0]
[1010, 79]
p04047
u089032001
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\nA = list(map(int, input().split())).sort()\nans = 0\nfor a, b in zip(A, A[1:]):\n ans += a\nprint(ans)', 'n = int(input())\nA = sorted(list(map(int, input().split())))\nans = 0\nflag = True\nfor i in reversed(range(len(A))):\n if flag is False:\n flag = True\n continue\n if i - 1 < 0:\n continue\n ans += A[i - 1]\n flag = False\nprint(ans)']
['Runtime Error', 'Accepted']
['s662189078', 's340117548']
[2940.0, 3060.0]
[19.0, 17.0]
[116, 236]
p04047
u094191970
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=sorted(list(map(int,input().split())),reverse=True)\ncnt=0\nfor i in range(0,2*n,2):\n cnt+=l[i+1]\n print(i)\nprint(cnt)', 'n=int(input())\nl=sorted(list(map(int,input().split())),reverse=True)\ncnt=0\nfor i in range(0,2*n,2):\n cnt+=l[i+1]\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s660244198', 's259017753']
[3060.0, 2940.0]
[17.0, 17.0]
[139, 126]
p04047
u097317219
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nans = 0\ni = 0\nwhile(i<N):\n ans += L[i]\n i += 2', 'N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nans = 0\ni = 0\nwhile(i<N):\n ans += L[i]\n i += 2\nprint(ans)', 'N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nans = 0\ni = 0\nwhile(i<2*N):\n ans += L[i]\n i += 2\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s799692358', 's990267260', 's761578572']
[2940.0, 3060.0, 3060.0]
[17.0, 18.0, 17.0]
[109, 120, 122]
p04047
u102960641
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\na = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(0,2*n,2):\n ans += i\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nprint(sum(a[::2]))']
['Wrong Answer', 'Accepted']
['s722522411', 's614373314']
[2940.0, 2940.0]
[18.0, 17.0]
[115, 80]
p04047
u111421568
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n, k = map(int, input().split())\n\nimport sys\n\nsys.setrecursionlimit(20000)\n\nl = [[] for i in range(n)]\nfor i in range(n-1):\n a, b = map(int, input().split())\n l[a-1].append(b-1)\n l[b-1].append(a-1)\n\ndef first_search(first, depth):\n record = 0\n for i in l[first]:\n temp = search(first, i, depth-1)\n if record < temp:\n record = temp\n return record + 1\n\ndef search(before, now, depth):\n if depth <= 0:\n return 1\n else:\n ans = 1\n for i in l[now]:\n if before != i:\n ans += search(now, i, depth-1)\n return ans\n\nret = 0 \nfor i in range(n):\n temp = first_search(i, k)\n if temp > ret:\n ret = temp\n \nif ret > n:\n print(0)\nelse:\n print(n-ret)', 'n = int(input())\n\nl = list(map(int, input().split()))\n\nans = 0\n\nl = sorted(l)\n\nfor i in range(n):\n ans += l[2*i]\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s868836591', 's062223905']
[3064.0, 2940.0]
[18.0, 17.0]
[763, 131]
p04047
u155594782
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N=input("Enter No. of Servings :")\nL=list(map(int,input("Enter skew Lengths").split()))\n\n# no of ingrediants counter \nitems=0\n\n\nwhile(L):\n\n\t# select large and secong large at beggining\n\tif L[0]<L[1] :\n\t\ts_lg=L[0]\n\t\tlg=L[1]\n\telse:\n\t\ts_lg=L[1]\n\t\tlg=L[0]\n\n\t# if more than 2 elements are there in list\t\n\tif len(L)>2:\n\t\tfor i in range(2,len(L)) :\n\t\t\tif L[i]>=lg:\n\t\t\t\ts_lg=lg\n\t\t\t\tlg=L[i]\n\t\t\telif L[i]>=s_lg :\n\t\t\t\ts_lg=L[i]\n\n\t# after getting largest and sec_largest of remaining list\n\t# we only count least one and add to indrediants\n\titems=items+s_lg\n\n\t# we remove them and continue operation with remaining list\n\tL.remove(s_lg)\n\tL.remove(lg)\t\n\nprint(items)\t', 'N=input()\nL=list(map(int,input().split()))\n\nitems=0\n\nwhile(L):\n\n\tif L[0]<L[1] :\n\t\ts_lg=L[0]\n\t\tlg=L[1]\n\telse:\n\t\ts_lg=L[1]\n\t\tlg=L[0]\n\n\tif len(L)>2:\n\t\tfor i in range(2,len(L)) :\n\t\t\tif L[i]>=lg:\n\t\t\t\ts_lg=lg\n\t\t\t\tlg=L[i]\n\t\t\telif L[i]>=s_lg :\n\t\t\t\ts_lg=L[i]\n\n\titems=items+s_lg\n\n\tL.remove(s_lg)\n\tL.remove(lg)\t\n\nprint(items)\t']
['Wrong Answer', 'Accepted']
['s930949335', 's480172327']
[3064.0, 3064.0]
[20.0, 20.0]
[652, 315]
p04047
u161318582
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['a = input()\nx = sorted(list(map(int,input().split())))\ncnt=0\nfor i in range(a):\n cnt += x[2*i]\nprint(cnt)', 'a = input()\nx = sorted(list(map(int,input().split())))\ncnt=0\nfor i in range(a-1):\n cnt += x[2*i]\nprint(cnt)\n', 'a = int(input())\nx = sorted(list(map(int,input().split())))\ncnt=0\nfor i in range(a-1):\n cnt += x[2*i]\nprint(cnt)', 'a = int(input())\nprint(a)\nx = sorted(list(map(int,input().split())))\nprint(x)\ncnt=0\nfor i in range(a):\n cnt += x[2*i]\nprint(cnt)', 'a = int(input())\nx = sorted(list(map(int,input().split())))\ncnt=0\nfor i in range(a):\n cnt += x[2*i]\nprint(cnt)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s168606739', 's529233422', 's807295113', 's925741221', 's161942030']
[2940.0, 2940.0, 2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 18.0, 18.0]
[106, 109, 113, 129, 111]
p04047
u164678731
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['# coding: utf-8\n# Your code here!\nn = int(input())\nl = list(map(int, input().split()))\nl.sort()\nans = 0\nfor i in range(n):\n if i % 2 == 0:\n ans += l[i]\n\nprint(ans)\n', '# coding: utf-8\n# Your code here!\nn = int(input())\nl = list(map(int, input().split()))\nl.sort()\nans = 0\nfor i in range(2 * n):\n if i % 2 == 0:\n ans += l[i]\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s087109571', 's834184018']
[2940.0, 2940.0]
[17.0, 17.0]
[174, 178]
p04047
u169639579
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = int(input())\n\ns = map(int,input().split())\n\nlist(s).sort(reverse=True)\n\nsum = 0\n\nfor i in range(N):\n sum = sum +list(s)[2*i]\n\nprint(sum)', 'N = int(input())\n\ns = input().split()\n\ns.sort(reverse=True)\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i]\n\nprint(sum)', 'N = int(input())\n\ns = map(int,input().split())\n\ns.sort()\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i+1]\n\nprint(sum)', 'N = int(input())\n\ns = map(int,input().split())\n\ns.sort(reverse=True)\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i]\n\nprint(sum)', 'N = int(input())\n\ns = map(int,input().split())\n\ns.sort()\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i]\n\nprint(sum)', 'N = int(input())\n\ns = list(map(int,input().split()))\n\ns.sort(reverse=True)\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i]\n\nprint(sum)', 'N = int(input())\n\ns = list(map(int,input().split()))\n\ns.sort()\n\nsum = 0\n\nfor i in range(N):\n sum = sum + s[2*i]\n\nprint(sum)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s043187364', 's147710525', 's292103477', 's359938455', 's663985852', 's872725915', 's284810303']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[141, 121, 120, 130, 118, 136, 124]
p04047
u173374079
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = input\nl = map(int, input().split())\nl = sorted(l)\n\nans = 0\nfor i in range(len(n)):\n a = l[2*i]\n b = l[2*i+1]\n ans =+ min(a,b)\n\nprint(ans)', 'n = input()\nl = map(int, input().split())\nl = sorted(l)\n \nans = 0\nfor i in range(len(n)):\n a = l[2*i]\n b = l[2*i+1]\n ans =+ min(a,b)\n \nprint(ans)', 'n = int(input())\nl = map(int, input().split())\nl = sorted(l)\n\nans = 0\nfor i in range(n):\n a = l[2 * i]\n b = l[2 * i + 1]\n ans = ans + min(a, b)\n\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s382251638', 's475341440', 's574482299']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0]
[144, 148, 164]
p04047
u190882678
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['input_word = input()\ninput_list = input_word.split(" ")\nN = int(input_list[0])\nK = int(input_list[1])\ninput_word = input()\ntmp_list = input_word.split(" ")\ninput_list = [ int(i) for i in tmp_list ]\n\nwhile True:\n flag = 0\n for i in range(1,N):\n number = input_list.index(i)\n number_1 = input_list.index(i+1)\n if number - number_1 >= K:\n input_list[number_1],input_list[number] = input_list[number],input_list[number_1]\n flag = 1\n break\n if flag == 0:\n break\n\nfor i in input_list:\n print(i)\n ', 'input_word = input()\nN = int(input_word)\ninput_word = input()\ntmp_list = input_word.split(" ")\ninput_list = [ int(i) for i in tmp_list ]\n\ninput_list.sort()\nprint(input_list)\noutput = 0\nfor i in range(N):\n output += input_list[2*i]\n\nprint(output)\n ', 'input_word = input()\nN = int(input_word)\ninput_word = input()\ntmp_list = input_word.split(" ")\ninput_list = [ int(i) for i in tmp_list ]\ninput_list.sort()\noutput = 0\nfor i in range(N):\n output += input_list[2*i]\nprint(output)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s234847450', 's315683671', 's938986030']
[3064.0, 2940.0, 3060.0]
[18.0, 18.0, 18.0]
[532, 253, 226]
p04047
u201968280
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\ntable = list(map(int,input().split()))\ntable.sort()\ncount = 0\nfor i in range(1,n+1):\n if i%2 = 1:\n count += table[i]\n else:\n pass\nprint(count)', 'n = int(input())\ntable = list(map(int,input().split()))\ntable.sort()\ncount = 0\nfor i in range(n):\n if i%2 == 0:\n count += table[i]\n else:\n pass\nprint(count)', 'n = int(input())\ntable = list(map(int,input().split()))\ntable.sort()\ncount = 0\nfor i in range(n):\n if i%2 = 0:\n count += table[i]\n else:\n pass\nprint(count)', 'n = int(input())\ntable = list(map(int,input().split()))\ntable.sort()\ncount = 0\nfor i in range(2*n):\n if i%2 == 0:\n count += table[i]\n else:\n pass\nprint(count)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s142733593', 's504432518', 's874033754', 's716553727']
[2940.0, 3060.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 18.0]
[179, 176, 175, 178]
p04047
u233747425
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nans = 0\nfor i in range(0, 2*N, 2):\n ans += min(L[i], L[i+1])\n\nprint(ans)', 'n = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nans = 0\nfor i in range(0, 2*n, 2):\n ans += min(L[i], L[i+1])\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s189986491', 's608129758']
[2940.0, 2940.0]
[17.0, 17.0]
[140, 140]
p04047
u248145581
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nN, X = list(map(int, input().split()))\nsum_ = X\nprev = X\nnext = N - X\ni = 0\nwhile True:\n num = prev // next\n if i == 0:\n sum_ += 2 * num * next\n elif i % 2 == 1:\n sum_ += 2 * num * next - next\n else:\n sum_ += 2 * num * next - next\n mod_ = prev % next\n if mod_ == 0:\n break\n sum_ += next\n prev = next\n next = mod_\n i += 1\nprint(sum_)', '#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nN = int(input())\nLs = list(map(int, input().split()))\nsorted_ = sorted(Ls)\nlist_ = []\nfor i, x in enumerate(sorted_):\n if i % 2 == 0:\n list_.append(x)\nsum_ = sum(list_)\nprint(sum_)']
['Runtime Error', 'Accepted']
['s911514871', 's815029133']
[3064.0, 3064.0]
[38.0, 39.0]
[437, 237]
p04047
u256031597
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nsum(L[::2])', 'N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nprint(sum(L[::2]))']
['Wrong Answer', 'Accepted']
['s071462461', 's205462902']
[2940.0, 2940.0]
[18.0, 18.0]
[73, 80]
p04047
u258375111
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nx=list(map(int,input().split()))\n\nx.sort()\nans=0\n\nfor i range(n):\n if i%2==1:\n pass\n else:\n ans+=min(x[i],x[i+1])\n \nprint(ans)', 'n=int(input())\nx=list(map(int,input().split()))\n\nx.sort()\nans=0\n\nfor i in range(n):\n if i%2==1:\n pass\n else:\n ans+=min(x[i],x[i+1])\n \nprint(ans)\n', 'n=int(input())\nx=list(map(int,input().split()))\n\nx.sort()\nans=0\n\nfor i range(n):\n ans=+x[i*2]\n \nprint(ans)\n', 'n=int(input())\nx=list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)\n', 'n=int(input())\n\nx=list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)\n', 'n=int(input())\nx=list(map(int,input().split()))\n\nx.sort()\nans=0\n\nfor i range(n):\n ans+=x[i*2]\n \nprint(ans)\n', 'n=int(input())\na=[]\ncou=0\n\nfor i in range(n*2):\n a[i]=int(input())\n \na.sort()\nfor i*2 in range(n):\n cou+=min(a[i],a[i+1])\n \nprint(cou)', 'n=int(input())\nx=list(map(int,input().split()))\n\nx.sort()\nans=0\n\nfor i range(n):\n ans=ans+x[i*2]\n \nprint(ans)\n', 'n= int(input())\n\nx= list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)\n', 'n=int(input())\nx=list(map(int, input().split()))\n\nx.sort()\n\nans=0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)\n', 'n = int(input())\n\nx = list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)', 'n=int(input())\nx=list(map(int, input().split()))\n\nx.sort()\n\nans=0\n\nfor i range(n):\n ans=ans+x[i*2]\n \nprint(ans)\n', 'n = int(input())\n\nx = list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)\n', 'n=int(input())\nx=list(map(int, input().split()))\n\nx.sort()\nans=0\n\nfor i range(n):\n ans=ans+x[i*2]\n \nprint(ans)\n', 'n = int(input())\n\nx = list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i range(n):\n ans = ans + x[i*2]\n \nprint(ans)', 'n = int(input())\n\nx = list(map(int, input().split()))\n\nx.sort()\n\nans = 0\n\nfor i in range(n):\n ans = ans + x[i*2]\n \nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s028269684', 's069392363', 's333585563', 's373380643', 's422829839', 's529235642', 's568274783', 's634476725', 's638403161', 's712750022', 's725018604', 's739326319', 's855412902', 's881546734', 's950638019', 's460026072']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0, 17.0, 18.0, 17.0, 18.0, 17.0, 18.0, 18.0, 17.0, 17.0, 20.0, 18.0, 18.0]
[152, 156, 111, 122, 123, 111, 138, 114, 125, 120, 126, 116, 127, 115, 126, 129]
p04047
u258647915
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['class Scanner:\n def readint(self): return int(input())\n def readstring(self): return input().rstrip()\n def readline(self): return list(map(int, input().split()))\n def reads(self): return list(input().split())\n def newmat(self, n, x): return [[x for i in range(n)] for j in range(n)]\n\nsc = Scanner()\nn = sc.readint()\nL = sc.readline()\nL.sort()\nprint(L[::2])\nprint(sum(L[::2]))', 'd=input()\nprint(sum(sorted(list(map(int, input().split())))[::2]))']
['Wrong Answer', 'Accepted']
['s551339451', 's839491466']
[3064.0, 3064.0]
[23.0, 23.0]
[390, 66]
p04047
u268516119
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['input()\nL=[int(l) for l in input().split()]\nprint(sum(L[1::2]))', 'input()\nL=[int(l) for l in input().split()]\nL.sort(reverse=True)\nprint(sum(L[1::2]))']
['Wrong Answer', 'Accepted']
['s597965678', 's454632175']
[2940.0, 2940.0]
[17.0, 17.0]
[63, 84]
p04047
u269390702
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nsum=0\nfor x in range(0,n*2,2):\n sum+=max(l[x:x+2])\nprint(sum)\n', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nsum=0\nfor x in range(0,n*2+1,2):\n sum+=min(l[x:x+2])\nprint(sum)\n', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nsum=0\nfor x in range(0,n*2,2):\n sum+=min(l[x:x+2])\nprint(sum)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s006495156', 's742049259', 's790511885']
[2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0]
[122, 124, 122]
p04047
u272266919
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = input()\nLi = map(int, input().split(" "))\nLi.sort()\ntotal = 0\nfor i in Li[0::2]\n total += i\nprint(total)\n', 'N = input()\nLi = list(map(int, input().split(" ")))\nLi.sort()\ntotal = 0\nfor i in Li[0::2]:\n total += i\nprint(total)\n']
['Runtime Error', 'Accepted']
['s036529572', 's449574172']
[2940.0, 2940.0]
[17.0, 17.0]
[112, 119]
p04047
u273928723
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=input()\na=input().split()\na=[int(i) for i in a]\na=a.sorted()\ncount=0\nans=0\nfor i in a:\n if count%2==0:\n ans+=i\n count+=1', 'n=input()\na=input().split()\na=[int(i) for i in a]\na.sort()\ncount=0\nans=0\nfor i in a:\n if count%2==0:\n ans+=i\n count+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s454116567', 's424416476']
[3060.0, 3316.0]
[18.0, 20.0]
[127, 134]
p04047
u291945537
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['m=0\nn=int(input())\nkushi= list(map(int,input().split()))\nkushi.sort()\nprint(kushi)\n\nif len(kushi) %2==1:\n\tdel kushi[-1]\n\nfor i in range(0,len(kushi)-1,2):\n\tif kushi[i]>kushi[i+1]:\n\t\tm+=kushi[i+1]\n\telse:\n\t\tm+=kushi[i]\nprint(m)', 'm=0\nn=int(input())\nkushi= list(map(int,input().split()))\nkushi.sort()\n\nif len(kushi) %2==1:\n\tdel kushi[-1]\n\nfor i in range(0,len(kushi)-1,2):\n\tif kushi[i]>kushi[i+1]:\n\t\tm+=kushi[i+1]\n\telse:\n\t\tm+=kushi[i]\nprint(m)']
['Wrong Answer', 'Accepted']
['s991313230', 's383141645']
[3064.0, 7396.0]
[40.0, 685.0]
[225, 212]
p04047
u292454598
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['kusiyaki = int(input())\nkushi = []\n\nfor i in range(kusiyaki*2):\n kushi.append(int(input()))\n \nkushi = sorted(kushi)\nprint(sum(kushi[0::2]))', "kusiyaki = int(input('作りたい串焼きの本数を入力してください:'))\nkushi = [None] * kusiyaki * 2\ni = 0\nsum = 0\n\nfor kushi_length in kushi:\n kushi_length = input('串の長さを入力してください:')\n kushi[i] = int(kushi_length)\n i += 1\n\n\nkushi = sorted(kushi)\nkushi_min_length = kushi[0:len(kushi):2]\nprint(kushi)\nprint(kushi_min_length)\nfor length in kushi_min_length:\n sum += int(length)\n\nprint(sum)", 'a = int(input())\nb = sorted(map(int,input().split()))\nprint(sum(b[0::2]))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s095870176', 's500945371', 's646905199']
[2940.0, 3064.0, 2940.0]
[18.0, 17.0, 17.0]
[141, 433, 73]
p04047
u298297089
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['num = int(input())\nnum_list = sorted(list(map(int, input().split())))\nprint(num_list)\ni = 0\nsum = 0\nwhile i < num * 2:\n sum += num_list[i]\n i += 2\nprint(sum)', 'num = input()\nnum_list = list(map(int, input().split()))sort()\ni = 0\nsum = 0\nwhile i < num * 2:\n sum += num_list[i]\n i += 2\nprint(sum)', 'num = int(input())\nnum_list = sorted(list(map(int, input().split())))\ni = 0\nsum = 0\nwhile i < num * 2:\n sum += num_list[i]\n i += 2\nprint(sum)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s186083937', 's857914787', 's914086802']
[3060.0, 2940.0, 3060.0]
[19.0, 18.0, 20.0]
[159, 136, 143]
p04047
u305052967
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = input()\nL = list(map(int,input().split())\n\nL.sort\n\ns = 0\n\nfor n in range(N):\n s += L[2*n]\nprint(s)', 'N = int(input())\nL = list(map(int,input().split())\n \nL.sort()\n \ns = 0\n \nfor n in range(N):\n s += L[2*n]\nprint(s)', 'N = int(input())\nL = list(map(int, input().split()))\n\nL.sort()\ns = 0\n\nfor n in range(N):\n s += L[2*n}\n\nprint(s)', 'N =int( input())\nL = list(map(int,input().split())\n \nL.sort\n \ns = 0\n \nfor n in range(N):\n s += L[2*n]\nprint(s)', 'N = input()\nL = list(map(int,input().split())\n \nL.sort()\n \ns = 0\n \nfor n in range(N):\n s += L[2*n]\nprint(s)', 'N = int(input())\nL = list(map(int, input().split()))\n \nL.sort()\ns = 0\n \nfor n in range(N):\n s += L[2*n]\n \nprint(s)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s045552452', 's297416464', 's342698874', 's587747630', 's602627412', 's894217862']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[105, 115, 114, 113, 110, 118]
p04047
u328510800
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['5\n100 1 2 3 14 15 58 58 58 29\n', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nres = 0\nfor i in range(0, 2*n, 2):\n res += min(a[i], a[i+1])\n\nprint(res)']
['Runtime Error', 'Accepted']
['s887744334', 's154691539']
[2940.0, 2940.0]
[17.0, 18.0]
[30, 135]
p04047
u329058683
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N=int(input())\nL=list(map(int,input().split()))\nL.sort()\nS=0\nfor i in L[::2]:\n S=S+1\nprint(S)', 'N=int(input())\nL=list(map(int,input().split()))\nL.sort()\nS=0\nfor i in L[::2]:\n S=S+i\nprint(S)']
['Wrong Answer', 'Accepted']
['s525791798', 's149817137']
[2940.0, 2940.0]
[17.0, 17.0]
[94, 94]
p04047
u333139319
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\nl = [int(i) for i in input().split()]\na = 0\nfor i in l:\n if i % 2 == 0:\n a = a + i\nprint(a)\n', 'n = int(input())\nl = [int(i) for i in input().split()]\na = 0\nfor i in range(len(l)):\n if i % 2 == 0:\n a = a + l[i]\nprint(a)\n', 'n = int(input())\nl = [int(i) for i in input().split()]\na = 0\nfor i in len(l):\n if i % 2 == 0:\n a = a + l[i]\nprint(a)\n', 'n = int(input())\nl = [int(i) for i in input().split()]\na = 0\nl.sort()\nfor i in range(len(l)):\n if i % 2 == 0:\n a = a + l[i]\nprint(a)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s434992981', 's544500326', 's595342593', 's230215182']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 17.0]
[119, 134, 127, 143]
p04047
u333873045
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['def pair(n,count):\n l=[];su=0\n for i in range(0,len(n),2):\n sub=list()\n sub.append(n[i:i+2])\n su=su+sub[0][0]\n l.append(sub)\n return(su)\n \n\n \nip1=5\nip2=[100,1,2,3,14,15,58 ,58, 58, 29]\nip2.sort()\nprint(pair(ip2,ip1))\n', 'def pair(n,count):\n l=[];su=0\n for i in range(0,len(n),2):\n sub=list()\n sub.append(n[i:i+2])\n su=su+sub[0][0]\n l.append(sub)\n return(su)\n \n\n \nip1=int(input())\nip2=[]\nfor i in range(ip1*2):\n ip2.append(int(input()))\nip2.sort()\nprint(pair(ip2,ip1))', "def pair(n,count):\n l=[];su=0\n for i in range(0,len(n),2):\n sub=list()\n sub.append(n[i:i+2])\n su=su+sub[0][0]\n l.append(sub)\n return(su)\n \ndef ip11(): return int(input())\ndef ip22(): return [int(_) for _ in input().split()]\n \n\ndef main():\n ip1=ip11()\n ip2=ip22()\n ip2.sort()\n print(pair(ip2,ip1))\n return\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s096671164', 's665951821', 's100156181']
[3060.0, 3064.0, 3064.0]
[17.0, 17.0, 18.0]
[268, 300, 408]
p04047
u342321365
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['def bbq():\n n = int(input())\n a = input()\n tmp = a.split()\n l = [int(x) for x in tmp]\n l.sort()\n n = 0\n i = 0\n while(i<n:\n n += l[i]\n i += 2\n print (n)\n\nif __name__ == "__main__":\n bbq()', 'def bbq():\n n = int(input())\n a = input()\n tmp = a.split()\n l = [int(x) for x in tmp]\n l.sort()\n n = 0\n i = 0\n while(i<len(l)):\n n += l[i]\n i += 2\n print (n)\n\nif __name__ == "__main__":\n bbq()']
['Runtime Error', 'Accepted']
['s902533382', 's113778330']
[7272.0, 7272.0]
[1621.0, 1140.0]
[230, 236]
p04047
u350049649
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N=int(input())\nL=list(map(int,input().split()))\nL.sort(reverse=True)\nprint(sum(L[:N]))', 'N=int(input())\nL=list(map(int,input().split()))\nL.sort()\nprint(sum(L[0::2]))\n']
['Wrong Answer', 'Accepted']
['s768256424', 's567023316']
[2940.0, 2940.0]
[17.0, 18.0]
[86, 77]
p04047
u353919145
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\na=map(int,input().split())\nans=0\nfor i in range(0,2*n,2):\n ans+=a[i+1]\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nans=0\nfor i in range(0,2*n,2):\n ans+=a[i]\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s933900905', 's297362460']
[9068.0, 9024.0]
[24.0, 26.0]
[99, 113]
p04047
u361841553
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = int(input())\nlist_input = map(int, raw_input().split())\n\nlist_input = sorted(list_input)\nsums = 0\nfor i in range(0,2*N,2):\n sums += min(list_input[i],list_input[i+1])\n\nprint(sums)\n', 'N = int(raw_input())\nlist_input = map(int, raw_input().split())\n\nlist_input = sorted(list_input)\nsums = 0\nfor i in range(0,2*N,2):\n print(i)\n sums += min(list_input[i],list_input[i+1])\nprint(sums)', 'N = input()\nlist_input = map(int, raw_input().split())\n\nlist_input = sorted(list_input)\nsums = 0\nfor i in range(0,2*N,2):\n sums += min(list_input[i],list_input[i+1])\n\nprint(sums)', 'N = input()\nlist_input = map(int, raw_input().split())\n\nlist_input = sorted(list_input)\nsums = 0\nfor i in range(N,2*N):\n sums += list_input[i]\n\nprint(sums)', 'N = int(raw_input())\nlist_input = sorted(map(int, raw_input().split()))\nprint(sum(list_input[::2]))', 'N = int(raw_input())\nlist_input = map(int, raw_input().split())\n\nlist_input = sorted(list_input)\nsums = 0\nfor i in range(0,2*N,2):\n sums += min(list_input[i],list_input[i+1])\n\nprint(sums)\n', 'N = int(input())\nlist_input = sorted(map(int, input().split()))\nprint(sum(list_input[::2]))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s122802468', 's272670636', 's373040472', 's565058803', 's620457516', 's974009912', 's565406375']
[2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[187, 202, 181, 158, 99, 191, 91]
p04047
u371467115
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=[input() for i in range(n)]\nl.sort()\ns=0\nfor j in l[::2]:\n s+=j\nprint(s)', 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nprint(sum(l[::2]))']
['Runtime Error', 'Accepted']
['s928145687', 's146619672']
[2940.0, 2940.0]
[18.0, 18.0]
[92, 75]
p04047
u388415336
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['num_meals = int(input())\nskewers = list(map(int, input().split()))\nskewers.sort()\nprint(skewers)\ningredients = 0\nfor skewer in range(0,(len(skewers) - 1),+2):\n print(skewers[skewer])\n ingredients = ingredients + skewers[skewer]\nprint(ingredients)\n', 'num_meals = int(input())\nskewers = list(map(int, input().split()))\nskewers.sort()\ningredients = 0\nfor skewer in range(0,(len(skewers) - 1),+2):\n ingredients = ingredients + skewers[skewer]\nprint(ingredients)\n']
['Wrong Answer', 'Accepted']
['s441997779', 's452973775']
[3060.0, 2940.0]
[17.0, 17.0]
[253, 211]
p04047
u398988238
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N=int(input())\ninp=input()\nL=[int(val) for val in inp.split()]\nL=sorted(L,reverse=True)\ntotal=0\nstart=0\nfor _ in range(N):\n total+=min(L[start],L[start+1])\n start+=2\n ', 'N=int(input())\narray=input()\nL=[int(val) for val in array.split()]\nL=sorted(L)\ntotal=0\nstart=0\nP=[L for val in L]\nfor _ in range(N):\n total+=min(P[start],P[start+1])\n P.pop(start)\n P.pop(start+1)\n start+=2\nprint(total)', 'N=int(input())\narray=input()\nL=[int(val) for val in array.split()]\nL=sorted(L,reverse=True)\nprint(L)\ntotal=0\nstart=0\nfor _ in range(N):\n total+=min(L[start],L[start+1])\n #print(L[start])\n #print(L[start]L[start+1])\n start+=2\nprint(total)', 'N=int(input())\ninp=input()\nL=[int(val) for val in inp.split()]\nL=sorted(L,reverse=True)\ntotal=0\nstart=0\nfor _ in range(N):\n total+=min(L[start],L[start+1])\n start+=2\nprint(total)\n']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s434491224', 's821577378', 's823388939', 's899413153']
[9132.0, 9192.0, 9168.0, 9072.0]
[32.0, 23.0, 26.0, 29.0]
[169, 222, 241, 181]
p04047
u433184056
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N, X = map(int, intpu().split())\nif X <= N / 3:\n result = 3 * (N - X)\nif N / 3 < X and X < N /2:\n result = 6 * X\nif N / 2 <= X:\n result = 3 * X\nprint(result)', 'N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nsum = 0\nfor i in range(N):\n x = L.pop(0)\n y = L.pop(0)\n sum += x\nprint(sum)']
['Runtime Error', 'Accepted']
['s617678939', 's897629416']
[2940.0, 3060.0]
[18.0, 20.0]
[166, 146]
p04047
u436484848
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
["num = int(input())\nstr = input()\nLi = list(map(int,str.split(' ')))\nLi.sort()\nsum = 0 \nfor i in range(0,num,2):\n\tsum += Li[i]\nprint(sum)\n", "num = int(input())\nstr = input()\nLi = list(map(int,str.split(' ')))\nLi.sort()\nsum = 0 \nif len(Li)%2 == 1:\n\tLi = Li[1:]\nfor i in range(0,len(Li),2):\n\tsum += Li[i]\nprint(sum)"]
['Wrong Answer', 'Accepted']
['s171083271', 's840491940']
[3064.0, 3064.0]
[38.0, 40.0]
[137, 172]
p04047
u459233539
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=sorted(list(map(int,iput().split()),reverse=True)\nprint(sum(l[1::2])', 'n=int(input())\nl=sorted(list(map(int,iput().split())),reverse=True)\nprint(sum(l[1::2])', 'n=int(input())\nl=sorted(list(map(int,input().split())),reverse=True)\nprint(sum(l[1::2])', 'n=int(input())\nl=sorted(list(map(int,input().split())),reverse=True)\nprint(sum(l[1::2]))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s008080090', 's445061163', 's736262531', 's858618987']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 19.0, 17.0]
[85, 86, 87, 88]
p04047
u464852639
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N = int(input())\nL = map(int, input().split())\nsort(L)\nsum = 0\nfor i in range(0,N):\n sum += L[i*2]\nprint(sum)', 'N = int(input())\nL = map(int, input().split())\nsort(L)\nsum = 0\nfor i in range(0,len(L),2):\n sum += L[i]\nprint(sum)', 'N = int(input())\nL = map(int, input().split())\nsort(L)\nsum = 0\nfor i in range(0,len(L),2):\n\tsum += L[i]\nprint(sum)', 'N = int(input())\nL = [int(x) for x in input().split()]\nlist.sort(L)\nsum = 0\nfor i in range(0,len(L),2):\n\tsum += L[i]\nprint(sum)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s046243738', 's203588797', 's524941267', 's911330308']
[3188.0, 3188.0, 3064.0, 3188.0]
[41.0, 41.0, 40.0, 41.0]
[112, 117, 114, 128]
p04047
u468972478
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\na = sorted(list(map(int, input().split())))\ns = 0\nfor i in range(2*n-1):\n s += min(a[i], a[i+1])\nprint(s)', 'n = int(input())\na = sorted(map(int, input().split()))\ns = 0\nfor i in range(2n-1):\n s += min(a[i], a[i+1])\nprint(s)', 'n = int(input())\na = sorted(list(map(int, input().split())))\ns = 0\nfor i in range(n):\n if i % 2 == 0:\n s += a[i]\nprint(s)', 'n = int(input())\na = sorted(list(map(int, input().split())))\ns = 0\nfor i in range(2 * n):\n if i % 2 == 0:\n s += a[i]\nprint(s)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s395096539', 's604076487', 's998359224', 's034960174']
[9164.0, 9020.0, 9144.0, 9144.0]
[26.0, 27.0, 31.0, 27.0]
[123, 116, 125, 129]
p04047
u491018097
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
["\nif __name__ == '__main__':\n a = [int(i) for i in input().split()]\n a.sort()\n print(sum(a[::2]))", 'input()\na = [int(i) for i in input().split()]\na.sort()\nprint(sum(a[::2]))\n']
['Wrong Answer', 'Accepted']
['s771445926', 's832507792']
[3064.0, 3064.0]
[22.0, 23.0]
[105, 74]
p04047
u491402843
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['N=int,input()\ndata= list(map(int, input().split()))\ndata.sort()\nprint(data)\nj=0\nfor i in range(0,len(data),2):\n\tj+=data[i]\nprint(j)', 'N=int(input())\ndata= list(map(int, input().split()))\ndata.sort()\nj=0\nfor i in range(0,2*N,2):\n\tj+=data[i]\nprint(j)']
['Wrong Answer', 'Accepted']
['s100740478', 's502440204']
[2940.0, 2940.0]
[17.0, 18.0]
[131, 114]
p04047
u493520238
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
["def calc(ab1,ab2):\n meat = ab1[0] + ab2[0]\n vege = ab1[1] + ab2[1]\n pattern = fact_list[meat+vege] / (fact_list[meat] * fact_list[vege])\n return pattern\n \n \nif __name__ == '__main__':\n N = int(input())\n AB = [list(map(int, input().split())) for i in range(N)]\n \n fact_list = {}\n fact_list[0] = 1\n # max_ab = max(AB[x][0] + AB[x][1] for x in range(N))\n for i in range(1,4001):\n fact_list[i] = (fact_list[i-1] * i) % (10**9 + 7)\n \n sum_count = 0\n for i in range(N):\n for j in range(i+1,N):\n sum_count += calc(AB[i],AB[j])\n sum_count = sum_count % (10**9 + 7)\n \n print( int(sum_count % (10**9 + 7)) )", "\nif __name__ == '__main__':\n N = int(input())\n L = list(map(int, input().split()))\n L = sorted(L)\n \n count = 0;\n for i in range(N):\n count += L[i*2]\n print(count)"]
['Wrong Answer', 'Accepted']
['s924694031', 's041837538']
[3572.0, 6892.0]
[42.0, 1313.0]
[672, 190]
p04047
u518042385
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=list(map(int,input().split()))\nl=set(l)\nz=0\nfor i in range(n):\n z+=l[2*i]\nprint(z)\n ', 'n=int(input())\nl=list(map(int,input().split()))\nl=sorted(l)\nz=0\nfor i in range(n):\n z+=l[2*i]\nprint(z)']
['Runtime Error', 'Accepted']
['s133312272', 's283756273']
[2940.0, 2940.0]
[18.0, 17.0]
[108, 103]
p04047
u525796732
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nprint(l)\nans=sum(l[0::2])\nprint(ans)', "def main():\n n,x=map(int,input().split())\n a,b=n-x,x\n if(a<b):\n a,b=b,a\n path_length = calc_path(a,b,n)\n print(path_length)\n\ndef calc_path(a1,b1,c1):\n q , mod=divmod(a1,b1)\n count=0\n if mod==0:\n c2=c1+2*b1*q-b1\n return c2\n else:\n count=count+1\n c2=c1+2*b1*q\n a2=a1-b1*q\n b2=b1\n if(a2<b2):\n a2,b2=b2,a2\n return calc_path(a2,b2,c2)\nif __name__=='__main__':\n main()\n", "def main():\n n,x=map(int,input().split())\n a,b=n-x,x\n if(a<b):\n a,b=b,a\n path_length = calc_path(a,b,n)\n print(path_length)\n\ndef calc_path(a1,b1,c1):\n q , mod=divmod(a1,b1)\n count=0\n if mod==0:\n c2=c1+b1*(q+1)\n return c2\n else:\n count=count+1\n c2=c1+b1*(q+1)\n a2=a1-b1*q\n b2=b1\n if(a2<b2):\n a2,b2=b2,a2\n return calc_path(a2,b2,c2)\nif __name__=='__main__':\n main()\n", 'n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=sum(l[0::2])\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s478908964', 's576295253', 's947081620', 's854890339']
[2940.0, 3064.0, 3064.0, 2940.0]
[17.0, 18.0, 17.0, 20.0]
[93, 466, 467, 84]
p04047
u537782349
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['a = int(input())\nb = list(map(int, input().split()))\nb.sort()\nc = 0\nfor i in range(len(b)-1, 0, -2):\n c += min(b[i], b[i-1])\n\n', 'a = int(input())\nb = list(map(int, input().split()))\nb = sorted(b, reverse=True)\nc = 0\nfor i in range(1, len(b), 2):\n c += min(b[i], b[i-1])\nprint(c)\n']
['Wrong Answer', 'Accepted']
['s599119375', 's017090555']
[2940.0, 2940.0]
[17.0, 17.0]
[129, 153]
p04047
u543954314
2,000
262,144
Snuke is having a barbeque party. At the party, he will make N servings of _Skewer Meal_. Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients. To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients. What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?
['n = int(input())\nl = sorted(list(map(int, input().split())))\ns = 0\nfor i in range(0,n,2):\n s += l[i]\nprint(s)', 'n = int(input())\nl = sorted(list(map(int, input().split())))\ns = 0\nfor i in range(0,n*2,2):\n s += l[i]\nprint(s)']
['Wrong Answer', 'Accepted']
['s269658949', 's548319384']
[2940.0, 2940.0]
[18.0, 17.0]
[112, 114]