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
p03200
u864197622
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
['N = int(input())\n\nX = [[] for i in range(N)]\nP = [-1] * N\n\nfor i in range(N-1):\n x, y = map(int, input().split())\n X[x-1].append(y-1)\n X[y-1].append(x-1)\n\n\ndef set_parent(i):\n # print(i)\n for a in X[i]:\n if a != P[i]:\n P[a] = i\n # print(a)\n X[a]....
['Runtime Error', 'Accepted']
['s588291493', 's598226478']
[3628.0, 3500.0]
[19.0, 66.0]
[1084, 134]
p03200
u880466014
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["S = input()\nN = len(S)\nsum = 0\nflg = False\nS = S[::-1]\n\nfor i in range(N):\n if S[i] == 'W':\n flg = True\n elif S[i] == 'B' and flg:\n sum += i\nprint(sum)", "S = input()\nN = len(S)\nsum = 0\ncount = 0\nflg = False\nS = S[::-1]\n\nfor i in range(N):\n if S[i] == 'W':\n count += 1\n flg = True\n...
['Wrong Answer', 'Accepted']
['s672961768', 's659302414']
[3500.0, 3500.0]
[60.0, 70.0]
[159, 188]
p03200
u898967808
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["s = input()\n\ncw = 0\nans = 0\nfor i in range(n):\n if s[i] == 'W':\n ans += i-cw\n cw += 1\n \nprint(ans) \n \n ", "s = input()\n \ncw = 0\nans = 0\nfor i in range(len(s)):\n if s[i] == 'W':\n ans += i-cw\n cw += 1\n \nprint(ans) "]
['Runtime Error', 'Accepted']
['s728398542', 's849180576']
[9176.0, 9284.0]
[25.0, 63.0]
[120, 118]
p03200
u912650255
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["S = list(input())\n\nprint(S)\n\ncount = 0\ni = 0\nwhile i < len(S)-1:\n if S[i]=='B' and S[i+1]=='W':\n S[i]='W'\n S[i+1]='B'\n count += 1\n if i > 0:\n i -= 1\n else:\n i += 1\n else:\n i += 1\nprint(count)", "S = input()\n\ncount = 0\nblack ...
['Wrong Answer', 'Accepted']
['s908961626', 's512032272']
[12264.0, 9324.0]
[2206.0, 88.0]
[265, 201]
p03200
u914992391
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["from sys import stdin\n\ndef main():\n A = list(map(int,stdin.readline().replace('B', '0').replace('W', '1')))\n\n A=[0,0,1]\n wc = A.count(1)\n indices = [i for i, x in enumerate(A) if x == 1]\n if wc > 0:\n print(sum(indices) - 1*wc*(wc-1) //2 )\n else:\n print(sum(indices))\n\ninput = l...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s127432142', 's285846101', 's351787368', 's434840138', 's579216158', 's592570458', 's857322473']
[5156.0, 3500.0, 5152.0, 5152.0, 5156.0, 5092.0, 11176.0]
[50.0, 18.0, 47.0, 47.0, 50.0, 47.0, 37.0]
[336, 373, 421, 321, 322, 268, 350]
p03200
u923270446
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
['def ans():\n global cnt, s, l\n if s.count("BW") == 0:\n return None\n for i in range(s.count("BW")):\n print(s)\n cnt += 1\n l.pop(s.index("BW") + 1)\n l[s.index("BW"):s.index("BW") + 1] = ["W", "B"]\n s = "".join(l)\n ans()\ns = input()\nl = list(s)\ncnt = 0\nan...
['Runtime Error', 'Accepted']
['s036557832', 's254072261']
[136252.0, 9332.0]
[2104.0, 66.0]
[318, 76]
p03200
u929201588
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["# AtCoder Grand Contest 029\n# December 15, 2018\n#\n\nS = input()\ncount = 0\n\nwhile True:\n if S.find('BW') >= 0:\n S = S.replace('BW', 'WB', 1)\n count += 1\n print(S)\n else:\n break\n\nprint(count)", "S = input()\nN = len(S)\n\ncount = 0\nnum = 0\nidx = -1\nwhile True:\n idx = S.find('W', idx + 1...
['Runtime Error', 'Accepted']
['s052330941', 's332965378']
[134588.0, 3500.0]
[711.0, 98.0]
[202, 161]
p03200
u930970950
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
['from collections import Counter as C\nn = int(input())\nl = sorted(map(int, input().split()), reverse = True)\nc = C(l)\nres = 0\nfor e in l:\n for p in range(32, 0, -1):\n e_ = (1 << p) - e\n if c.get(e_, 0) > 0:\n # print(e, e_, c)\n c[e_] -= 1\n c[e] -= 1\n ...
['Runtime Error', 'Accepted']
['s100145574', 's038421850']
[3876.0, 5852.0]
[22.0, 135.0]
[347, 383]
p03200
u953020348
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
["S = input()\nprint(S.count('w')*2)\n", '# -*- coding: utf-8 -*-\nS = input()\nbcount=S.count(\'B\')\nwcount=S.count(\'W\')\nSlen=len(S)\nans=0\nbb=0\nfor i in range(Slen):\n if i!=Slen:\n if S[Slen-i-1]=="B":\n ans=ans+bb\n else:\n bb=bb+1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s878859230', 's406146703']
[3500.0, 3500.0]
[18.0, 81.0]
[34, 234]
p03200
u954774382
2,000
1,048,576
There are N Reversi pieces arranged in a row. (A _Reversi piece_ is a disc with a black side and a white side.) The state of each piece is represented by a string S of length N. If S_i=`B`, the i-th piece from the left is showing black; If S_i=`W`, the i-th piece from the left is showing white. Consider performing the...
['import sys\nfrom functools import lru_cache, cmp_to_key\nfrom heapq import merge, heapify, heappop, heappush\nfrom math import *\nfrom collections import defaultdict as dd, deque, Counter as C\nfrom itertools import combinations as comb, permutations as perm\nfrom bisect import bisect_left as bl, bisect_right as br, ...
['Wrong Answer', 'Accepted']
['s330609002', 's773052422']
[7232.0, 14852.0]
[175.0, 123.0]
[1075, 1068]
p03201
u013408661
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['def reversed_num(num):\n num_len=len(bin(num))-2\n f=2**num_len-1\n return num^f\nn=int(input())\nnumber=list(map(int,input().split()))\nnumber.sort()\nnumber.reversed()\ngoal=[]\nfor i in number:\n if i != reversed_num(i)+1:\n goal.append(reversed_num(i)+1)\n number.remove(reversed_num(i)+1)\nprint(len(set...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s061103995', 's246764492', 's290802000', 's406623831', 's570668578', 's606140987', 's677693936', 's683630076', 's686341109', 's715343108', 's849581020', 's864735167', 's910645192', 's648673677']
[26932.0, 26356.0, 2940.0, 26180.0, 25364.0, 2940.0, 25744.0, 2940.0, 42252.0, 26932.0, 25708.0, 27060.0, 25708.0, 25708.0]
[148.0, 2105.0, 18.0, 2104.0, 2104.0, 18.0, 2105.0, 19.0, 212.0, 277.0, 444.0, 2104.0, 430.0, 608.0]
[325, 288, 79, 335, 303, 960, 325, 975, 224, 318, 340, 341, 380, 1134]
p03201
u017810624
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import math\nimport bisect\nn=int(input())\na=list(map(int,input().split()))\na.sort()\nb=[]\nfor i in range(1,50):\n b.append(2**i)\nct=0\ncheck=[1]*n\nfor i in range(n-1,-1,-1):\n if a[i]==1:\n break\n if check[i]==1 and a[i] not in b:\n check[i]=0\n x=math.floor(math.log2(a[i]))\n x=b[x]-a[i]\n y...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s012315838', 's060970731', 's074573809', 's719113058']
[25840.0, 199916.0, 25496.0, 35396.0]
[781.0, 2115.0, 76.0, 764.0]
[707, 490, 572, 543]
p03201
u029169777
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import Counter\nimport math\n\nN=int(input())\n\nA=list(map(int,input().split()))\n\nanswer=0\nA.sort(reverse=True)\n\nAmax=A[0]\nlimit=1\nwhile(True):\n if limit>Amax:\n break;\n limit*=2\n\nAcounter=Counter(A)\nprint(Acounter)\n\nwhile(limit!=1):\n for number,count in Acounter.items():\n i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s734593976', 's994211767', 's738079905']
[53948.0, 53568.0, 33296.0]
[2105.0, 1026.0, 923.0]
[622, 966, 968]
p03201
u060392346
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import defaultdict\ndef log2(n):\n if n < 2:\n return 0\n else:\n return 1 + log2(n // 2)\n\nn = int(input())\na_list = list(map(int, input().split()))\nd = defaultdict(int)\na_list.sort()\n\nfor a in a_list:\n d[a] += 1\n\na_list = list(set(a_list))\nc = 0\nfor a in a_list:\n m = log2(a, 2...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s309408627', 's851018674', 's444334028']
[41228.0, 26932.0, 60660.0]
[308.0, 2104.0, 811.0]
[452, 384, 403]
p03201
u070561949
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['n = int(input())\na = list(map(int,input().split()))\na.sort(reverse=True)\n\nb = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, \n 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, \n 67108864, 134217728, 268435456, 536870912]\n\nsum = 0\ni = 0...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s365241990', 's398742576', 's464751669', 's698322090', 's777942441', 's237919609']
[27060.0, 40592.0, 27712.0, 27060.0, 159552.0, 26932.0]
[2104.0, 394.0, 844.0, 393.0, 2105.0, 1653.0]
[673, 720, 723, 707, 967, 352]
p03201
u091051505
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\nA = set([int(i) for i in input().split()])\nans = 0\nwhile A:\n a = A.pop()\n for i in range(2, 32):\n if (pow(2, i) - a) in A:\n ans += 1\n print(pow(2, i), a)\nprint(ans)', 'from collections import defaultdict\nfrom bisect import bisect_right\n\nballs_count = def...
['Wrong Answer', 'Accepted']
['s815487723', 's826904868']
[31140.0, 55136.0]
[2206.0, 351.0]
[216, 508]
p03201
u118642796
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\nA = list(map(int,input().split()))\nA.sort(reverse=True)\ndic = {}\nfor a in A:\n dic[a] = dic.get(a,0)+1\nans = 0\n\nfor a in A:\n small = (1<<(len(format(a+1,"b")))) - a\n if dic.get(a,0)>0:\n dic[a] -= 1\n if dic.get(small,0)>0:\n dic[small] -= 1\n ans += 1\nprint...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s024983844', 's249409444', 's442663214', 's488608738', 's679795170', 's917496833', 's998192099', 's432333400']
[33600.0, 34240.0, 25708.0, 33696.0, 34988.0, 33856.0, 33696.0, 33860.0]
[462.0, 449.0, 2104.0, 436.0, 481.0, 453.0, 430.0, 437.0]
[309, 310, 592, 326, 340, 304, 303, 408]
p03201
u138486156
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import Counter\nn = int(input())\nA = sorted(list(map(int, input().split())))[-1::-1]\nc = Counter(A)\nans = 0\nfor a in A:\n b = (1<<m.bit_length()) - a\n if a == b and c[a] > 1:\n c[a] -= 2\n ans += 1\n elif a != b and c[a] > 0 and c[b] > 0:\n c[a] -= 1\n c[b] -...
['Runtime Error', 'Accepted']
['s505826766', 's499780124']
[33476.0, 33604.0]
[202.0, 444.0]
[338, 338]
p03201
u142415823
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\n\nN = int(input())\nA = list(map(int, input().split()))\nlist_ = [2 ** i for i in range(30)]\nA.sort(reverse=True)\n\nans = 0\nwhile(len(A) > 0):\n a = A.pop()\n tmp = [i - a for i in list_ if i - a > 0]\n for b in tmp:\n i = bisect.bisect_left(A, b)\n if i < len(A) and A[i] == b...
['Wrong Answer', 'Accepted']
['s195946254', 's688855629']
[25708.0, 33296.0]
[2104.0, 393.0]
[378, 397]
p03201
u148423304
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import math\nn = int(input())\nl = sorted(list(map(int,input().split())))\nc = 0\nb = {}\nfor i in range(len(l)):\n if l[i] in b:\n b[l[i]] += 1\n else:\n b[l[i]] = 1\n\nfor i in range(len(l) - 1, -1, -1):\n if b[l[i]] == 0:\n continue\n t = l[i]\n b[l[i]] -= 1\n s = 2 ** math....
['Runtime Error', 'Accepted']
['s612070761', 's927476078']
[33168.0, 33168.0]
[240.0, 508.0]
[452, 449]
p03201
u263654061
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['n= int(input())\na = list(map(int, input().split()))\n\nli = []\n\nfor i in range(n):\n for t in range(1, 31):\n try:\n tmp = a[(i+1):n].index(2**t - a[i])\n li.append([a[i], a[tmp+i+1]])\n except:\n pass\n\nfrom itertools import combinations\n\nMAX = len(li)\n\nflag=...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s501828896', 's606009776', 's703054239', 's746278115', 's218110612']
[27060.0, 54588.0, 37100.0, 25964.0, 33296.0]
[2104.0, 2106.0, 2105.0, 172.0, 1078.0]
[755, 564, 493, 235, 482]
p03201
u268516119
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['#AGC030 B - Powers of two\nimport collections\nimport math\nN=int(input())\nA=list(map(int,input().split()))\nA.sort(reverse=True)\ncnter=collections.Counter(A)\nans=0\nfor a in A:\n inv=2**(int(math.log2(a))+1)\n if cnter[a]==0:\n continue\n if cnter[a]>=2 and a==inv//2:a\n cnter[a]=cnter[a]-2...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s201755518', 's336590816', 's443582406', 's494530137', 's590081437', 's627266043', 's727605073', 's744451337', 's860567016', 's490449850']
[2940.0, 2940.0, 33296.0, 21012.0, 19536.0, 2940.0, 33296.0, 2940.0, 33296.0, 33296.0]
[18.0, 18.0, 2105.0, 2105.0, 49.0, 18.0, 503.0, 18.0, 559.0, 541.0]
[428, 510, 414, 1034, 423, 428, 414, 441, 427, 411]
p03201
u268793453
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["def main():\n from collections import Counter\n import sys\n input = sys.stdin.buffer.readline\n\n _ = int(input())\n A = [int(i) for i in input().split()]\n\n ans = 0\n c = Counter(A)\n B = sorted(c.keys(), reverse=True)\n\n for b in B:\n if c[b] == 0:\n continue\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s010219074', 's634449960', 's977126775']
[33780.0, 27060.0, 56624.0]
[219.0, 2104.0, 511.0]
[613, 780, 620]
p03201
u281303342
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\nA = list(map(int,input().split()))\nA.sort(reverse=True)\n\nans1, ans2 = 0,0\n\nmaxA = max(A)\nB = [1]\nt = 1\nwhile t < maxA:\n t *= 2\n B.append(t)\n\nd = dict()\nfor i in range(N):\n if A[i] in d:\n d[A[i]] += 1\n else:\n d[A[i]] = 1\n\nfor i in range(N):\n t = 2**le...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s274495023', 's896928763', 's044485044']
[33424.0, 34736.0, 34736.0]
[439.0, 671.0, 502.0]
[444, 566, 586]
p03201
u284854859
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\n \nn = int(input())\na = list(map(int, input().split()))\na.sort()\n \nres = 0\nfor i in range(n - 1 , -1, -1):\n if a[i] == int(a[i]):\n b = 1\n while b <= a[i]:\n b =b*2\n \n j = bisect.bisect_left(a, b - a[i])\n if i > j:\n if b - a[i] == a[j]:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s287002468', 's694206515', 's739522469']
[25712.0, 25712.0, 25708.0]
[201.0, 148.0, 1196.0]
[409, 409, 411]
p03201
u297109012
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import Counter\n\ndef ans_solve(N, As):\n C = Counter(As)\n ans = 0\n for d in As:\n n = (2 ** d.bit_length()) - d\n if d != n:\n if C[d] > 0 and C.get(n, 0) > 0:\n C[d] -= 1\n C[n] -= 1\n ans += 1\n else:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s637182918', 's731156821', 's092380728']
[33216.0, 26180.0, 33344.0]
[317.0, 79.0, 388.0]
[477, 444, 495]
p03201
u309977459
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["import bisect\n\nN = int(input())\nA = list(map(int, input().split()))\n#N = 5\n#A = [3, 11, 14, 5, 13]\nA.sort()\n#A = range(100000, 0, -1)\n\ndef index(a, x):\n 'Locate the leftmost value exactly equal to x'\n i = bisect.bisect_left(a, x)\n if i != len(a) and a[i] == x:\n return i\n else:\n ...
['Wrong Answer', 'Accepted']
['s043630348', 's561449003']
[27060.0, 33296.0]
[2104.0, 514.0]
[748, 295]
p03201
u310431893
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import math\nN = int(input())\nA = sorted((int(i) for i in input().split()), reverse=True)\n\nk = 2**int(math.log(A[0], 2) + 1)\n\ndef f(A, k):\n if len(A) == 1:\n return 0\n\n v = A[0]\n\n while k >= 2*v:\n k //= 2\n w = k - v\n\n if w in A[1:]:\n print(k, "=", v, "+", w)\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s402399904', 's455682178', 's646945615', 's859767176']
[617968.0, 161088.0, 28436.0, 33296.0]
[2141.0, 2109.0, 2105.0, 687.0]
[393, 263, 231, 455]
p03201
u336721073
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\nA = list(map(int, input().split(" ")))\nA.sort()\nA = deque(A)\nans = 0\nt_max = len(bin(A[-1])) - 2\nfor t in range(t_max, 0, -1):\n while len(bin(A[-1])) - 2 > t:\n A.pop()\n if len(A) < 2: break\n if len(A) < 2: break\n pow2 = 1 << t\n A_tmp = deque()\n while t == len...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s382894820', 's603094496', 's927893762', 's961480147', 's963226937']
[26932.0, 26020.0, 27060.0, 2940.0, 26000.0]
[147.0, 150.0, 147.0, 17.0, 1321.0]
[641, 561, 654, 743, 742]
p03201
u347640436
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from bisect import bisect_right\nn = int(input())\nd = {}\nfor a in map(int, input().split()):\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\nalist = list(sorted(d.keys(), reverse = True))\namax = alist[0]\nt = 1\npower_of_two = []\nwhile t < 2 * amax:\n t *= 2\n power_of_two.append(t)\nresult = 0\nfor a in a...
['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s061514584', 's131843629', 's735434684', 's171677597']
[44592.0, 44592.0, 44688.0, 44704.0]
[2104.0, 2104.0, 412.0, 346.0]
[608, 584, 542, 524]
p03201
u350836088
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['n = int(input())\nA = list(map(int,input().split()))\nA.sort(reverse = True)\nd = {}\nfor a in A:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nans =0\nfor a in A:\n b = 2**(a.bit_length())-a\n if b in d:\n if d[b] >=1 and d[a] >= 1:\n ans += 1 \n d[b]-= 1\n ...
['Wrong Answer', 'Accepted']
['s590826076', 's936288617']
[33696.0, 33072.0]
[350.0, 367.0]
[342, 391]
p03201
u375616706
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import defaultdict\n\ndef get_smallest_power_of_2_over_N(N):\n return 2**N.bit_length()\n\nN = int(input())\nA = list(map(int,input().split()))\n\n\nA = sorted(A)\n\nans=0\nD=defaultdict(int)\n\nfor a in A:\n D[a]+=1\n\nfor i in reversed(range(N)):\n if D[A[i]]<=0:\n continue\n els...
['Wrong Answer', 'Accepted']
['s761476210', 's413764273']
[56188.0, 33424.0]
[533.0, 780.0]
[587, 487]
p03201
u391731808
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\nN = int(input())\n*A, = map(int,input().split())\nB = {}\nfor a in A:B[a] = B.get(a,0) + 1\nB = sorted(map(list,B.items()))\nbl = bisect.bisect_left\n\nans = 0\nwhile 1:\n b,n = B.pop()\n if not B : break\n c = (1<<(len(bin(b))-2)) - b\n i = bl(B,[c,0])\n if B[i][0] == c:\n m = mi...
['Runtime Error', 'Accepted']
['s366917149', 's846329843']
[48316.0, 48316.0]
[1116.0, 1193.0]
[364, 421]
p03201
u474270503
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N=int(input())\nA=list(map(int, input().split()))\n\nA.sort(reverse=True)\ndic={}\nfor a in A:\n dic[a]=dic.get(a,0)+1\nprint(dic)\n\nans=0\n\nfor a in A:\n small=(1<<(len(format(a,"b")))) -a\n if dic.get(a,0)>0 and dic.get(small,0)>0:\n dic[a]-=1\n dic[small]-=1\n ans+=1\nprint(ans)', '...
['Wrong Answer', 'Accepted']
['s333664825', 's916759348']
[34236.0, 33984.0]
[493.0, 448.0]
[297, 383]
p03201
u480887263
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['class Node:\n def __init__(self,data):\n self.data=data\n self.left=None\n self.right=None\nclass BST:\n def __init__(self,number_list):\n self.root=None\n for node in number_list:\n self.insert(node)\n def insert(self,data):\n n=self.root\n if n is...
['Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s226632035', 's426184840', 's764823343', 's878292739', 's134337480']
[60436.0, 44308.0, 46316.0, 26608.0, 35560.0]
[2108.0, 2106.0, 2106.0, 2104.0, 456.0]
[2105, 3064, 2900, 428, 288]
p03201
u497046426
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import Counter\n\nN = int(input())\n*A, = map(int, input().split())\ncnt = Counter(A)\nA = sorted(A, reverse=True)\nans = 0\nfor a in A:\n if a & (a - 1) != 0:\n cand = (1 << ((a - 1).bit_length()))\n if cnt[a] == 0 or cnt[cand] == 0: continue\n else:\n cand = a\n if...
['Wrong Answer', 'Accepted']
['s746231223', 's407950189']
[33296.0, 33296.0]
[351.0, 446.0]
[382, 386]
p03201
u550574002
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import collections\ndef hoge(n):\n k = 1 \n while k<=n:\n k*=2\n return k-n\nans = 0\ninput()\na = [int(x) for x in input().split()]\nc = collections.Counter(a)\nsa = list(set(a))\nsa.sort()\nfor i in range(len(sa)-1,-1,-1):\n print(i) \n x = sa[i]\n if c[x]<= 0:\n continue \n...
['Wrong Answer', 'Accepted']
['s561654092', 's246693374']
[61776.0, 61164.0]
[1440.0, 1166.0]
[423, 420]
p03201
u550943777
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["import math\n\nN = int(input())\na = list(map(int,input().split()))\na_odds = []\na_even = []\n\nfor i in range(N):\n if a[i]%2 != 0:\n a_odds.append(a[i])\n else:\n a_even.append(a[i])\n\na_odds.sort()\na_odds.reverse()\na_even.sort()\na_even.reverse()\n\ncount = 0\nalist = []\nmax= 0\nif a_odds!...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s014759265', 's335055585', 's296033285']
[25920.0, 26832.0, 33168.0]
[2105.0, 197.0, 511.0]
[1544, 149, 474]
p03201
u572142121
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N=int(input())\nA=list(map(int,input().split()))\nA=sorted(A)\nfrom collections import Counter as co\nD=co(A)\n\ncnt=0\nfor i in range(N):\n if D[A[-1-i]]>0:\n for j in range(1,16):\n d=2**j\n if A[-1-i]<d:\n e=d-A[-1-i]\n break\n if D[e]>0:\n cnt+=1\n D[A[-1-i]]-=1\n D[e...
['Runtime Error', 'Runtime Error', 'Accepted']
['s204392951', 's283645637', 's977946106']
[35796.0, 35884.0, 35772.0]
[156.0, 151.0, 459.0]
[326, 314, 269]
p03201
u572144347
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['\nimport copy\nN = int(input())\na = list(map(int, input().split()))\na.sort(reverse=True)\nb = {}\nfor c in a:\n try:\n b[c] += 1\n except:\n b[c] = 1\n\n\npow2 = 1\nwhile pow2 <= a[0]:\n pow2 *= 2\n\ncnt = 0\nfor aa in a:\n while aa < (pow2//2):\n pow2 //= 2\n v = aa\n rem = ...
['Wrong Answer', 'Accepted']
['s404101425', 's631259021']
[34112.0, 33696.0]
[435.0, 432.0]
[2141, 2217]
p03201
u588341295
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["# -*- coding: utf-8 -*-\n\nimport sys\nfrom collections import Counter\n\ndef input(): return sys.stdin.readline().strip()\ndef list2d(a, b, c): return [[c] * b for i in range(a)]\ndef list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]\ndef list4d(a, b, c, d, e): return [[[[e] * d for j in ran...
['Wrong Answer', 'Accepted']
['s302221398', 's926976235']
[33288.0, 33404.0]
[1753.0, 1980.0]
[952, 1226]
p03201
u593005350
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import collections\nN=int(input())\nx=list(map(int,input().split()))\nc=collections.Counter(x)\nt=[2**i for i in range(len(str(bin(max(x)*2))[2:])+1)[::-1]]\ncount=0\nstart=0\nx.sort()\nfor i in range(len(x))[::-1]:\n for j in range(len(t)):\n if t[j] < x[i]:\n break\n if t[j]-x[i] in c.ke...
['Wrong Answer', 'Accepted']
['s744998426', 's358534848']
[33296.0, 33296.0]
[1317.0, 772.0]
[565, 675]
p03201
u597486843
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['n = int(input())\na = list(map(int, input().split()))\na.sort(reverse = True)\nd = {}\ncount = 0\n\nfor x in a:\n if x not in d: d[x] = 0\n d[x] += 1\n \nfor i in range(len(a)):\n y = 2**a[i].bit_length() - a[i]\n if y in d and d[y] > 0:\n count += 1\n d[y] -= 1\n \nprint(co...
['Wrong Answer', 'Accepted']
['s489515396', 's769870926']
[33856.0, 33040.0]
[391.0, 416.0]
[314, 371]
p03201
u601344838
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['#include<bits/stdc++.h>\nusing namespace std;\nint main(){\n int N;cin>>N;\n vector<int>A(N);\n for(int &a:A)cin>>a;\n sort(A.begin(),A.end(),greater<int>());\n map<int,int>m;\n int ans=0;\n for(int a:A){\n if(m.count(a)&&m[a]>0)m[a]--,ans++;\n else m[(1<<(32-__builtin_clz(a)))-a]++;\n }\n cout<<ans<<e...
['Runtime Error', 'Accepted']
['s745560052', 's665547554']
[2940.0, 33168.0]
[18.0, 487.0]
[312, 328]
p03201
u606045429
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["#include <algorithm>\n\n#include <set>\n\n\nusing namespace std;\n\nuint32_t ceil2(uint32_t a)\n{\n uint32_t b = 1;\n while (a > b) {\n b <<= 1;\n }\n return b;\n}\n\nint main()\n{\n int N;\n cin >> N;\n\n multiset<int> S;\n vector<int> A(N);\n for (auto &&a : A) {\n cin >> a;...
['Runtime Error', 'Accepted']
['s312459470', 's749178175']
[2940.0, 33744.0]
[17.0, 515.0]
[674, 190]
p03201
u620480037
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\nfrom collections import deque\nN=int(input())\n\nE=deque()\nO=deque()\n\na=list(map(int,input().split()))\n\nfor i in range(len(a)):\n if a[i]%2==0:\n E.append(a[i])\n else:\n O.append(a[i])\n \nE=list(E)\nO=list(O)\nE.sort()\nO.sort()\n\nans=0\nfor e in range(len(E)):\n t...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s221872880', 's227085468', 's406779150']
[26000.0, 27060.0, 25492.0]
[2104.0, 722.0, 1543.0]
[759, 472, 531]
p03201
u631277801
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**5) \n \ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readlin...
['Wrong Answer', 'Accepted']
['s100221603', 's523540488']
[33404.0, 33404.0]
[680.0, 426.0]
[873, 947]
p03201
u667024514
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import math\nn= int(input())\nlis= list(map(int,input().split()))\nlis.sort(reverse=True)\nans=0\nwhile lis:\n a =lis.pop(0)\n num = 1 << len(str(bin(a)))\n num =num-a\n if num==0:num=a\n if num in lis:\n lis.remove(num)\n ans +=1\nprint(ans)\n', 'import math\nn= int(input())\nlis= list(map(int,input().spl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s024293522', 's605686516', 's652940978']
[27052.0, 26832.0, 33288.0]
[2104.0, 2108.0, 559.0]
[241, 236, 250]
p03201
u675918663
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["import sys\n\ndef main(l):\n u = set()\n l = list(sorted(l))\n for i, a in enumerate(reversed(l)):\n searching = (1 << a.bit_length()) - a\n for j, b in enumerate(l[:-i-1]):\n if b == searching and not j in u:\n u.add(j)\n break\n\n return len(u)\n\n\...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s123389799', 's125874260', 's163497213', 's890844477', 's541444269']
[26932.0, 36200.0, 7004.0, 36184.0, 44560.0]
[2108.0, 2105.0, 37.0, 2105.0, 337.0]
[378, 497, 360, 531, 606]
p03201
u711245972
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
["def binary_search(list, item):\n low = 0\n high = len(list) - 1\n while low <= high:\n mid = (low + high) //2\n guess = list[mid]\n if guess == item:\n return mid\n if guess > item:\n high = mid -1\n else:\n low = mid + 1\n\n return mid\n...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s168813239', 's196096725', 's434527160', 's438376352', 's562256234', 's701937886', 's736094643', 's761517544', 's837447079', 's923772750', 's971062775', 's175761439']
[25708.0, 26932.0, 27444.0, 27444.0, 26932.0, 26704.0, 26704.0, 27444.0, 26832.0, 26932.0, 27444.0, 33296.0]
[413.0, 2104.0, 579.0, 2105.0, 2105.0, 335.0, 2104.0, 2104.0, 2104.0, 363.0, 2105.0, 583.0]
[612, 280, 602, 610, 263, 216, 347, 610, 233, 249, 617, 320]
p03201
u750641007
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
[' N=int(input())\n lis=list(map(int,input().split()))\n lis.sort()\n sum=0\n while(len(lis)>1):\n v=lis.pop()\n k=1\n while k<=v:\n k*=2\n m=k-v\n if m in lis:\n sum+=1\n lis.remove(m)\n\n print(sum)', 'N=int(input())\n lis=list(m...
['Runtime Error', 'Runtime Error', 'Accepted']
['s425568348', 's847971043', 's262703334']
[2940.0, 2940.0, 39988.0]
[17.0, 17.0, 1286.0]
[270, 699, 567]
p03201
u754022296
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import sys\ninput = sys.stdin.readline\nfrom collections import Counter\nimport bisect\ndef pow_two(x):\n c = 0\n while x:\n x //= 2\n c += 1\n k = 2**c\n if x*2 == c:\n return -1\n return k\n\nn = int(input())\nA = sorted(list(map(int, input().split())))\ncount = dict(Counter(A))\nans = 0\nfor i in A[:...
['Wrong Answer', 'Accepted']
['s410802184', 's530675354']
[39436.0, 33424.0]
[1035.0, 401.0]
[508, 384]
p03201
u782685137
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['input()\na=sorted(map(int,input().split()))[::-1]\ns={}\nr=0\nfor v in a:\n\tfor i in range(31)[::-1]:\n\t\tp=2**-~i-v\n\t\tif p in s and s[p]>0:r+=1;s[p]-=1;break\n\t\telse:s[v]=s.get(v,0)+1\nprint(r)', 'input()\na=sorted(map(int,input().split()))[::-1]\ns={}\nl=[2**-~i for i in range(31)[::-1]]\nr=0\nfor v in a:\n\...
['Wrong Answer', 'Accepted']
['s380340482', 's029267626']
[26612.0, 32832.0]
[2105.0, 1239.0]
[185, 201]
p03201
u787562674
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['# -*- coding: utf-8 -*-\nimport collections\n \nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nc=collections.Counter(A)\n \npairCounter=0\n \nbeki=29\nnibeki=2**beki\n \nfor i in range(N):\n target = A[i]\n if c[target] < 1:\n continue\n c[target]-= 1\n \n w...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s111811046', 's127124507', 's709679898']
[2940.0, 33296.0, 33168.0]
[17.0, 251.0, 452.0]
[498, 481, 538]
p03201
u816116805
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n\n"""\nagc 029 B\n"""\n\nfrom collections import Counter\n\nn = int(input())\nali = list(map(int, input().split()))\nali.sort(reverse=True)\n\nc = Counter(ali)\nprint(c)\nans = 0\n\n\ndef pow2(n):\n m = n\n tmp = 1\n while m > 0:\n tmp = tmp << 1\n...
['Wrong Answer', 'Accepted']
['s721813324', 's879297663']
[53568.0, 33296.0]
[2105.0, 1368.0]
[546, 610]
p03201
u858136677
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['def invbisect(a,x):\n right = len(a)-1\n left = 0\n while abs(left-right) > 1:\n if a[(left+right)//2] <= x:\n right = (left+right)//2\n else:\n left = (left+right)//2\n return right\n\nn = int(input())\na = list(map(int,input().split()))\ntwo = [2]\ni = 0\nwhile two[i]...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s100365397', 's891961463', 's985436153']
[27060.0, 33296.0, 33296.0]
[2105.0, 2105.0, 523.0]
[752, 515, 451]
p03201
u864197622
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\n\nN = int(input())\nA = [int(a) for a in input().split()]\nA = sorted(A)\n\nc = 0\nfor i in range(N - 1 , -1, -1):\n b = 1\n while b <= A[i]:\n b <<= 1\n \n j = bisect.bisect_left(A, b - A[i])\n if b - A[i] == A[j]:\n c += 1\n A[j] = A[j] - 0.5\n A[i] = A[i] +...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s266859280', 's565984327', 's644913388', 's748016041']
[25836.0, 25836.0, 25888.0, 25840.0]
[1581.0, 1296.0, 1590.0, 1490.0]
[317, 371, 291, 404]
p03201
u871352270
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\nball = list(map(int, input().split()))\nball.sort(reverse = True)\nok = {}\nfor x in ball:\n if x in ok:\n dic[x] += 1\n else:\n dic[x] = 1\nans = 0\nfor x in ball:\n if ok[x] != 0:\n y = 2**(x.bit_length()) - x\n if ok[y] != 0:\n if y == x and ok[y] =...
['Runtime Error', 'Accepted']
['s328465304', 's912951050']
[25924.0, 33696.0]
[148.0, 337.0]
[414, 456]
p03201
u875291233
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['# coding: utf-8\n# Your code here!\n\nimport bisect\n\nn=int(input())\na = [int(i) for i in input().split()]\na.sort()\ncheck = [0]*n\nprint(a)\n\nans=0\n\nwhile(a):\n c=a.pop()\n d=c\n keta=0\n while(d!=0):\n d=d//2\n keta +=1\n x = 2**keta - c\n# print(c,x)\n i = bisect.bisect_lef...
['Wrong Answer', 'Accepted']
['s121095877', 's257550937']
[25836.0, 33216.0]
[2104.0, 1837.0]
[419, 580]
p03201
u883048396
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['N = int(input())\naA = sorted([int(_) for _ in input().split()],reverse=True)\naA1 = [ _ for _ in aA if _ % 2 ]\naA0 = [ _ for _ in aA if _ % 2 == 0 ]\n\n\ndef searchPair(aD):\n iL = len(aD)\n dsT =set()\n iC = 0\n for i in range(iL):\n for j in range(i+1,iL):\n if i in dsT or j in dsT:\...
['Wrong Answer', 'Accepted']
['s612608751', 's358336790']
[26932.0, 44560.0]
[2104.0, 373.0]
[603, 899]
p03201
u894258749
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import bisect\ninpl = lambda: list(map(int,input().split()))\nN = int(input())\nA = sorted(inpl())\nused = [0] * N\n\nans = 0\nfor i in range(1,N):\n if used[-i] == 1:\n continue\n p = len(bin(A[-i]))-3\n B = (1 << (p+1)) - A[-i]\n m = bisect.bisect_left(A,B,0,N-i)\n if m < N-i and used[m] == 0 and A[m] == B:...
['Wrong Answer', 'Accepted']
['s634516585', 's884846961']
[27060.0, 33940.0]
[524.0, 765.0]
[370, 601]
p03201
u905582793
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from math import log2\nimport heapq as hq\nfrom collections import Counter\nn = int(input())\na = list(map(int,input().split()))\nc = Counter(a)\na = [-a[i] for i in range(n)]\nhq.heapify(a)\nans = 0\nwhile a:\n x = hq.heappop(a)\n x = -x\n if c[x]>0:\n y = 2**(int(log2(x))+1)\n if c[y-x]>0:\n ans += 1\...
['Wrong Answer', 'Accepted']
['s767676248', 's729564515']
[33432.0, 33432.0]
[718.0, 679.0]
[347, 423]
p03201
u914992391
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['# -*- coding: utf-8 -*-\nimport copy\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse=True)\n\npairCounter=0\nfor i in range(N):\n if A[i] < 0:\n continue\n for b in range(9):\n beki=2**b\n if beki > A[i]:\n pair= beki - A[i]\n if pair in A:\n A[A.index(pair)] = -1\...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s144645249', 's152063445', 's461014043', 's475108185', 's515518069', 's630939351', 's700051433', 's703035446', 's738956372', 's791631488', 's810459907', 's825700922', 's902995315', 's932733308']
[27444.0, 26612.0, 27444.0, 26932.0, 27564.0, 27120.0, 27216.0, 33296.0, 27444.0, 26836.0, 27216.0, 26704.0, 27216.0, 33296.0]
[2104.0, 2104.0, 2104.0, 66.0, 2104.0, 2104.0, 2105.0, 477.0, 2104.0, 2104.0, 911.0, 2104.0, 236.0, 446.0]
[381, 325, 378, 390, 379, 381, 389, 432, 727, 608, 408, 373, 391, 449]
p03201
u952708174
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['def b_powers_of_two(N, A):\n \n from bisect import bisect_left\n a = sorted(A)\n ans = 0\n for j in range(N - 1, -1, -1):\n \n b = 1\n while b <= a[j]:\n b <<= 1\n\n k = bisect_left(a, b - a[j])\n if k < j and (b - a[j] == a[k]):\n \n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s326045461', 's331657386', 's107147785']
[3064.0, 3064.0, 26180.0]
[18.0, 19.0, 1153.0]
[1224, 1224, 1241]
p03201
u961595602
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['# -*- coding: utf-8 -*-\nfrom sys import stdin\nimport numpy as np\n\nd_in = lambda: int(stdin.readline()) # N = d_in()\nds_in = lambda: list(map(int, stdin.readline().split())) # List = ds_in()\n\nN = d_in()\nA_list = np.array(ds_in())\nA_list.sort()\nEPSILON = 10**(-6)\n\ncand_A = 2 ** (np.log2(A_list + EPSILON)....
['Wrong Answer', 'Accepted']
['s220364636', 's714081852']
[34412.0, 48448.0]
[2109.0, 595.0]
[614, 677]
p03201
u969190727
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['import math\nn=int(input())\nA=[int(i) for i in input().split()]\nB=[]\nfor a in A:\n B.append(a)\nA.sort(reverse=True)\ncount=0\nfor i in range(n):\n cur=A[i]\n if cur in B:\n k=int(math.log2(cur))+1\n pair=2**k-cur\n if pair in B:\n B.remove(pair)\n count+=1\nprint(count)', 'import math\nn=int...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s029200949', 's262193212', 's760200219']
[26608.0, 26832.0, 39356.0]
[2104.0, 2104.0, 672.0]
[280, 301, 458]
p03201
u997113115
2,000
1,048,576
Takahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i. He would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2. Note that a ball cannot belong to multiple pairs. Find the maximum possible number of pai...
['from collections import defaultdict\n\nN = int(input())\nA = sorted(list(map(int, input().split())), reverse=True)\ndic = defaultdict(int)\nfor a in A:\n dic[a] = 1\n\nans = 0\nfor i in range(N):\n if dic[A[i]] != 0:\n b = 2**(A[i].bit_length()) - A[i]\n if dic[b]:\n ans += 1\n ...
['Wrong Answer', 'Accepted']
['s559859471', 's791755026']
[56188.0, 56188.0]
[438.0, 431.0]
[343, 408]
p03203
u070561949
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['# Debug Print\nisdbg = True\ndef dprint(*value,sep=\' \',end=\'\\n\'):\n if isdbg:\n print(*value,sep=sep,end=end)\n\n\nH,W,N = map(int,input().split())\n\n\nBL = {}\nfor i in range(N):\n x1,y1 = map(int,input().split())\n #XY[x1-1][y1-1] = 1\n BL[str(x1-1) + "," + str(y1-1)] = x1+y1-2\n\n \n\n#if...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s436132614', 's879949961', 's664449172']
[51760.0, 500272.0, 62788.0]
[1058.0, 2138.0, 1307.0]
[979, 1101, 987]
p03203
u077337864
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(pow(10, 6))\n\ndef main():\n h, w, n = map(int, input().split())\n xy = [tuple(map(int, input().split())) for _ in range(n)]\n miny = [float("inf") for _ in range(h + 1)]\n for x, y in xy:\n miny[x - 1] = min(miny[x - 1], y - 1)\n min...
['Wrong Answer', 'Accepted']
['s836016639', 's386111838']
[42524.0, 42524.0]
[422.0, 481.0]
[602, 611]
p03203
u368780724
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['from collections import defaultdict\nimport sys\ndef inpl(): return [int(i) for i in input().split()]\nH, W, N = inpl()\nif not N:\n print(W)\n sys.exit()\nA = []\nB = defaultdict(lambda: [])\nC = defaultdict(lambda: W)\nfor _ in range(N):\n x, y = inpl()\n A.append((x,y))\n B[y].append(x)\nT = [0]*(H+...
['Runtime Error', 'Accepted']
['s501138719', 's440524549']
[79700.0, 75756.0]
[1345.0, 1969.0]
[656, 644]
p03203
u532966492
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['def input(): return next(input_sample)\n\n\ninput_sample = iter("""\n100000 100000 0\n""".split("\\n")[1:-1])\n\n\ndef main():\n h, w, n = map(int, input().split())\n xy = [tuple(map(lambda x:int(x)-1, input().split())) for _ in [0]*n]\n ans = h\n d = set(xy)\n block = [[h] for _ in [0]*w]\n for x, ...
['Wrong Answer', 'Accepted']
['s562746987', 's504800881']
[23908.0, 82916.0]
[171.0, 1449.0]
[829, 722]
p03203
u792050702
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['x,y,num = map(int, input().split())\ngaiz = [x]*x\nkaisu = x\nfor _ in range(num):\n xg,yg = map(int,input().split())\n if xg >= yg:\n sa = xg-yg\n if yg < gaiz[sa]:\n gaiz[sa]=(yg)\nprint(gaiz) \n\nif len(gaiz) ==0:\n print(kaisu)\nelse:\n for num,(maegai,gai) in enumerate(zip(ga...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s004578926', 's191185345', 's488842620', 's605259459']
[12304.0, 32868.0, 51556.0, 10868.0]
[671.0, 2105.0, 2104.0, 644.0]
[411, 849, 793, 400]
p03203
u894258749
2,000
1,048,576
Takahashi and Aoki will play a game using a grid with H rows and W columns of square cells. There are N obstacles on this grid; the i-th obstacle is at (X_i,Y_i). Here, we represent the cell at the i-th row and j-th column (1 \leq i \leq H, 1 \leq j \leq W) by (i,j). There is no obstacle at (1,1), and there is a piece ...
['import numpy as np\n(H,W,N) = map(int,input().split())\nif N==0:\n print(W)\n exit()\nXY = np.array([ list(map(int,input().split())) for _ in range(N)], dtype=np.int)\nX = XY[:,0]\nY = XY[:,1]\ndiff = X - Y\nind = np.where(diff >= 0)[0]\nM = len(ind)\nif M==0:\n print(W)\n exit()\norder = X[ind].argsort()...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s224949440', 's771817905', 's903833366']
[65868.0, 63888.0, 60084.0]
[2110.0, 2110.0, 1472.0]
[687, 670, 748]
p03206
u000623733
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N, K = map(int, input().split())\nh_list = []\nfor _ in range(N):\n h_list.append(int(input()))\nh_list.sort()\n\nerr_list = [h_list[i+K-1] - h_list[i] for i in range(N-K+1)]\nprint(min(err_list))\n', "D = int(input())\n\nch = 'Christmas'\nfor _ in range(25 - D):\n ch += ' Eve'\nprint(ch)"]
['Runtime Error', 'Accepted']
['s160954486', 's408848341']
[2940.0, 2940.0]
[18.0, 18.0]
[193, 85]
p03206
u011212399
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['n = int(input())\na = [int(input()) for i in range(n)]\na = sorted(a)\nprint((max(a) // 2) + sum(a) -max(a))', "print('Christmas' + ' Eve'*(25-int(input())))"]
['Runtime Error', 'Accepted']
['s310357844', 's656981889']
[2940.0, 2940.0]
[18.0, 18.0]
[105, 45]
p03206
u013756322
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N, K = map(int, input().split())\nh = [int(input()) for _ in range(N)]\nh = sorted(h)\nprint(min(h[i+K-1]-h[i] for i in range(N-K+1)))\n', 'p=[int(input()) for i in range(int(input()))]\nprint(sum(p)-max(p)//2)', 'n, x = map(int, input().split())\n\n\ndef pi(n):\n return 2**(n+1)-1\n\n\ndef ai(n):\n return 2**(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s106492871', 's128751053', 's872835665', 's755004836']
[2940.0, 2940.0, 3188.0, 2940.0]
[18.0, 17.0, 19.0, 18.0]
[132, 69, 463, 79]
p03206
u014139588
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['d = input()\nif d == 25:\n print("Christmas")\nelif d == 24:\n print("Christmas eve")\nelif d == 23:\n print("Christmas eve eve")\nelse:\n print("Christmas eve eve eve")', 'd = int(input())\nif d = 25:\n print("Christmas")\nelif d = 24:\n print("Christmas Eve")\nelif d = 23:\n print("Christmas Eve Eve")\nelse:...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s467710754', 's849110734', 's695136440']
[8808.0, 8796.0, 8956.0]
[27.0, 26.0, 28.0]
[165, 167, 170]
p03206
u018017456
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N = int(input())\na = [int(input()) for i in range(N)]\n\ntotal = int(max(a)/2)\nprint(max(a))\nprint(total)\na.remove(max(a))\nprint(a)\ntotal += sum(a)', "D=input()\n \nif D=='25':\n print('Christmas')\nelif D=='24':\n print('Christmas Eve')\nelif D=='23':\n print('Christmas Eve Eve')\nelif D=='22':\n p...
['Runtime Error', 'Accepted']
['s864140720', 's407984746']
[3060.0, 2940.0]
[17.0, 17.0]
[145, 181]
p03206
u023229441
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['if input()=="22":\n print("Christmas Eve Eve Eve")\nif input()=="23":\n print("Christmas Eve Eve")\nif input()=="24":\n print("Christmas Eve")\nif input()=="25":\n print("Christmas")', 'd=input()\nif d=="22":\n\tprint("Christmas Eve Eve Eve")\nif d=="23":\n\tprint("Christmas Eve Eve")\nif d=="24":\n\tprint("Chris...
['Runtime Error', 'Accepted']
['s905915804', 's646842680']
[2940.0, 2940.0]
[17.0, 17.0]
[179, 161]
p03206
u027403702
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['D = int(input().split())\nprint("Christmas" + "Eve" * (25 - D)', 'D = int(input().split())\nprint("Christmas" + "Eve" * (25 - D))', 'D = int(input())\nprint("Christmas" + " Eve" * (25 - D))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s169138697', 's293568428', 's154258588']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[61, 62, 55]
p03206
u027557357
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
["D=input()\nif D=25 :\n print('Christmas')\nelif D=24 :\n print('Christmas Eve')\nelif D=23 :\n print('Christmas Eve Eve')\nelif D=22 :\n print('Christmas Eve Eve Eve')", "D=int(input())\nif D==25 :\n print('Christmas')\nelif D==24 :\n print('Christmas Eve')\nelif D==23 :\n print('Christmas Eve Ev...
['Runtime Error', 'Accepted']
['s309588180', 's508724024']
[2940.0, 2940.0]
[17.0, 17.0]
[171, 180]
p03206
u027675217
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['d = int(input())\na,b = "Christmas","Eve"\nfor i in range(0,3):\n if d-i == 25:\n print("{}".format(a))\n elif d-i == 24:\n print("{} {}".format(a,b))\n elif d-i == 23:\n print("{} {} {}".format(a,b,b))\n elif d-i == 22:\n print("{} {} {} {}".format(a,b,b,b))\n', 'd = int(input...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s060191839', 's967006124', 's326288173']
[3064.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[290, 290, 230]
p03206
u029234056
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N,K=map(int,input().split(" "))\nH=[int(input()) for _ in range(N)]\nH.sort()\ntmax=10**9\nfor a in range(N-K+1):\n h1,h2=H[a],H[a+K]\n tmax=min(tmax,abs(h1-h2))\n if(tmax==0):\n break\nprint(tmax)', 'D=int(input())\nif D==25:\n print("Christmas")\nelif D==24:\n print("Christmas Eve")\nelif D==2...
['Runtime Error', 'Accepted']
['s332380648', 's187071335']
[3060.0, 2940.0]
[18.0, 18.0]
[204, 177]
p03206
u031157253
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['s="Christmas"\nfor i in range(25-int(input()):\n s += " Eve"\nprint(s)', 's="Christmas"\nfor i in range(25-int(input())):\n s += " Eve"\nprint(s)']
['Runtime Error', 'Accepted']
['s139736936', 's919523019']
[2940.0, 3060.0]
[17.0, 18.0]
[68, 69]
p03206
u033524082
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['D = int(input())\n\nif D==25:\n print("Christmas")\n elif D==24:\n print("Christmas Eve")\n elif D==23:\n print("Christmas Eve Eve")\n else D==22:\n print("Christmas Eve Eve Eve")', 'D = int(input())\n\nif D ==25:\n print("Christmas")\nelif D ==24:\n print("Christmas Eve")\nelif D ==23:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s381693427', 's999943030', 's552258171']
[2940.0, 2940.0, 2940.0]
[18.0, 18.0, 17.0]
[195, 175, 172]
p03206
u036744414
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['# coding:utf-8\n\nN = int(input())\nan = [int(input()) for i in range(N)]\n\nan.sort()\nan.reverse()\n\nprint(an)\n\nsum = 0\nfor i, ai in enumerate(an):\n if i == 0:\n sum += ai/2\n else:\n sum += ai\n\nprint(int(sum))', '# coding:utf-8\n\nN, X = map(int, input().split())\n\ndef eatBan(c, w):\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s816142792', 's861423325', 's867310914']
[3064.0, 3064.0, 2940.0]
[17.0, 17.0, 17.0]
[222, 1114, 121]
p03206
u038216098
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['D=int(input())\nif D=25 :\n print("Christmas")\nelif D=24 :\n print("Christmas Eve")\nelif D=23 :\n print("Christmas Eve Eve")\nelse :\n print("Christmas Eve Eve Eve")', 'D=int(input())\nif D==25 :\n print("Christmas")\nelif D==24 :\n print("Christmas Eve")\nelif D==23 :\n print("Christmas Eve Eve")\nelse :\n ...
['Runtime Error', 'Accepted']
['s823740816', 's191156776']
[8856.0, 9104.0]
[19.0, 23.0]
[163, 166]
p03206
u045408189
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
["d=input()\nprint('Chiristmas' if d=='25' else 'Chiristmas Eve' if d=='24' else 'Chiristmas Eve Eve' if d=='23' else 'Chiristmas Eve Eve Eve')", "d=input()\nprint('Christmas' if d=='25' else 'Christmas Eve' if d=='24' else 'Christmas Eve Eve' if d=='23' else 'Christmas Eve Eve Eve')\n"]
['Wrong Answer', 'Accepted']
['s196266031', 's790127233']
[2940.0, 2940.0]
[17.0, 17.0]
[140, 137]
p03206
u047023156
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
["import sys\nintput = sys.stdin.readline()\n\nD = int(input())\nif D == 25:\n print('Christmas')\nelif D == 24:\n print('Christmas Eve')\nelif D == 23:\n print('Christmas Eve Eve')\nelif D == 22:\n print('Christmas Eve Eve Eve')", "import sys\ninput = sys.stdin.readline\n\nD = int(input())\nif D == 25:\n ...
['Runtime Error', 'Accepted']
['s623299687', 's118859964']
[2940.0, 2940.0]
[17.0, 17.0]
[228, 225]
p03206
u054471580
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['import sys\nn=input()\nlist = n.split(" ")\nn=int(list[0])\nk=int(list[1])\n\ntrees = []\nfor i in range(n):\n trees.append(int(input()))\n\ndef merge_sort(alist):\n if len(alist) <= 1:\n return alist\n \n mid = int(len(alist)/2)\n left = alist[:mid]\n right = alist[mid:]\n \n left = merge_sort(left)\n ri...
['Runtime Error', 'Accepted']
['s302709718', 's293898144']
[3064.0, 2940.0]
[18.0, 18.0]
[1050, 186]
p03206
u057429331
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N=input()\nif N==25:\n print("Christmas")\nelif N==24:\n print("Christmas Eve")\nelif N==23:\n print("Christmas Eve Eve")\nelif N==22:\n print("Christmas Eve Eve Eve")\n', 'N=int(input())\nif N==25:\n print("Christmas")\nelif N==24:\n print("Christmas Eve")\nelif N==23:\n print("Christmas Eve Eve...
['Wrong Answer', 'Accepted']
['s791053521', 's872902715']
[2940.0, 2940.0]
[17.0, 17.0]
[172, 177]
p03206
u058295774
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['#coding:utf-8\n\ndef count(a):\n\tif a == 25:\n\t\tprint "Christmas"\n\telif a == 24:\n\t\tprint "Christmas Eve"\n\telif a == 23:\n\t\tprint "Christmas Eve Eve"\n\telif a==22:\n\t\tprint "Christmas Eve Eve Eve"\n\nif __name__ == "__main__":\n print(\'入力してください\')\n b = input(\'a = \')\n count(b) ', '#cod...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s049545866', 's072906819', 's118683335', 's220194344', 's271391889', 's978834888']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[19.0, 18.0, 18.0, 18.0, 18.0, 19.0]
[295, 185, 288, 308, 307, 181]
p03206
u063346608
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['D = input()\n\nif D == "25"\n\tprint("Christmas")\nelif D == "24"\n\tprint("Christmas Eve")\nelif D == "23"\n\tprint("Christmas Eve Eve Eve")', 'D = input()\n \nif D == "25":\n\tprint("Christmas")\nelif D === "24":\n\tprint("Christmas Eve")\nelif D == "23":\n\tprint("Christmas Eve Eve")\nelif D == "22":\n\tprint("Chr...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s534797513', 's752746301', 's791616303', 's518223216']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[131, 181, 179, 177]
p03206
u066455063
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['n = int(input())\np = list(map(int, input().split()))\np.sort(reverse=True)\na = p[1:]\nb = p[0] // 2\nprint(sum(a, b))', 'D = int(input())\nif D == 25:\n print("Christmas")\nelse:\n E = 25 - D\n print("Christmas" + " " + "Eve " * E)']
['Runtime Error', 'Accepted']
['s631015399', 's603752788']
[2940.0, 2940.0]
[17.0, 19.0]
[114, 115]
p03206
u069035678
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['d=input()\nd=-(d-25)\nc="Chrismas"\ne="Eve"\nfor i in range(0,4):\n if d==i:\n print(c,end="")\n if i>0:\n for j in range(i-1):\n print(" "+e)\n print()\n ', 'd=int(input())\nd=-(d-25)\nc="Chrismas"\ne="Eve"\nfor i in range(0,4):\n if d==i:\n print(c,...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s239063723', 's608277387', 's856821509', 's987976616', 's769507454']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[201, 206, 213, 211, 212]
p03206
u071916806
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
["d=int(input())\nif d=25:\n print('Christmas')\nelif:\n print('Christmas Eve')\nelif:\n print('Christmas Eve Eve')\nelse:\n print('Christmas Eve Eve Eve')", "d=int(input())\nif d==25:\n print('Christmas')\nelif d==24:\n print('Christmas Eve')\nelif d==23:\n print('Christmas Eve Eve')\nelse:\n print('Christmas ...
['Runtime Error', 'Accepted']
['s093310274', 's507756950']
[2940.0, 2940.0]
[17.0, 17.0]
[149, 162]
p03206
u072606168
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
["d = int(input())\nif d = 25:\n print('Christmas')\nelif d = 24:\n print('Christmas Eve')\nelif d = 23:\n print('Christmas Eve Eve')\nelse:\n print('Christmas Eve Eve Eve')", "d = int(input())\nif d = 25:\n print('Christmas')\nelif d = 24:\n print('Christmas Eve')\nelif d = 23:\n print('Christmas Eve Eve')\nels...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s370197367', 's389808123', 's608261970', 's875423469']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 18.0, 18.0, 18.0]
[167, 174, 174, 170]
p03206
u073139376
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['print(["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"][int(input())+22]) ', 'print(["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"][int(input())-22]) \n']
['Runtime Error', 'Accepted']
['s990947766', 's419873294']
[2940.0, 2940.0]
[17.0, 17.0]
[101, 102]
p03206
u074445770
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['n=int(input())\nif n==25:\n print(Christmas)\nif n==24:\n print(Christmas Eve)\nif n==23:\n print(Christmas Eve Eve)\nif n==22:\n print(Christmas Eve Eve Eve)', 'print(Christmas Eve *(25-int(input())', 'n=int(input())\nif n=25:\n print(Christmas)\nif n=24:\n print(Christmas Eve)\nif n=23:\n print...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s173093236', 's332956732', 's735908307', 's111849359']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[162, 37, 158, 170]
p03206
u076512055
2,000
1,048,576
In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22.
['N, K = map(int, input().split())\nh = [0]*N\n\nfor n in range(N):\n h[n] = int(input())\n \nh.sort()\n\ntree = h[:K]\nheight = []\nheight.append(tree[-1]-tree[0])\n\nfor n in range(K,N):\n tree.pop(0)\n tree.append(h[n])\n height.append(tree[-1]-tree[0]) \n\nprint(min(height))', "D = int(input())\n\ni...
['Runtime Error', 'Accepted']
['s453160329', 's147866911']
[3064.0, 2940.0]
[17.0, 17.0]
[276, 180]