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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02773 | u614215819 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nstrlist = []\nN = int(input())\nfor i in range(N):\n strlist.append(str(input()))\nc = collections.Counter(strlist)\np = max(c.values())\nfor i in c.most_common():\n if i[1] == p:\n print(i[0])', 'import collections\nstrlist = []\nanswer = []\nN = int(input())\nfor i in range(N):\n strlist.append(str(input()))\n \nc = collections.Counter(sorted(strlist))\np = max(c.values())\nfor i in c.most_common():\n if i[1] == p:\n print("{}\\n".format(i[0]))', "import collections\nstrlist = []\nanswer = []\nN = int(input())\nfor i in range(N):\n strlist.append(str(input()))\n \nc = collections.Counter(strlist)\np = max(c.values())\nans = sorted([k for k,v in c.items() if p==v])\nprint('\\n'.join(ans))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s232773345', 's979275668', 's011679899'] | [46892.0, 47068.0, 37488.0] | [601.0, 804.0, 599.0] | [217, 257, 239] |
p02773 | u616382321 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\n\ncnt = collections.Counter(S)\nmax_cnt = max(cnt.values())\n\nans_list = []\n\nfor key, value in cnt.items():\n print(key, value)\n if value == max_cnt:\n ans_list.append(key)\n\nprint(*sorted(ans_list), sep='\\n')\n\n", "import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\n\ncnt = collections.Counter(S)\nmax_cnt = max(cnt.values())\n\nans_list = []\n\nfor key, value in cnt.items():\n if value == max_cnt:\n ans_list.append(key)\n\nprint(*sorted(ans_list), sep='\\n')\n\n"] | ['Wrong Answer', 'Accepted'] | ['s842331891', 's913446972'] | [38888.0, 38908.0] | [497.0, 399.0] | [287, 265] |
p02773 | u616542081 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\n\nS = []\n\nfor i in range(N):\n S.append(input())\n\nset_S = list(set(S))\nans = []\nmax_cnt = 0\nfor i in range(len(set_S)):\n cnt = 0\n for j in range(N):\n if set_S[i] == S[j]:\n cnt += 1\n if max_cnt < cnt:\n temp = [set_S[i],cnt]\n ans.append(temp)\n\nans_f = []\n\nfor i in range(len(set_S)):\n if ans[i][1] == max_cnt:\n ans_f.append(ans[i][0])\n\nans_f.sort()\n\nfor i in range(len(ans_f)):\n print(ans_f[i])', 'N = int(input())\n\nd = {}\n\nfor _ in range(N):\n S = input()\n if S in d:\n d[S] += 1\n else:\n d[S] = 1\n\nm = max(d.values())\n\nfor s in sorted(k for k in d if d[k] == m):\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s532706111', 's673742123'] | [35520.0, 35388.0] | [2206.0, 425.0] | [430, 183] |
p02773 | u617225232 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["# -*- coding: utf-8 -*-\nfrom collections import Counter\n# input\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\nc = Counter(s)\n# output\n#ma = c.most_common()[0][1]\no = list(k for k, v in s.items() if v == s.most_common()[0][1])\n\no.sort()\nprint('\\n'.join(o))\n", "# -*- coding: utf-8 -*-\nfrom collections import Counter\n# input\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\nc = Counter(s)\n# output\nma = c.most_common()[0][1]\n\no = [k for k, v in c.items() if v == ma]\n# o.sort()\n# print('\\n'.join(o))\nfor i in sorted(o):\n print(i)\n"] | ['Runtime Error', 'Accepted'] | ['s648174944', 's629258620'] | [35576.0, 45040.0] | [307.0, 682.0] | [316, 352] |
p02773 | u619084943 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\np = [input() for i in range(n)]\n\nc = collections.Counter(p)\nm = c.most_common()\nmost = m[0][1]\n\nanswer = []\n\nanswer.append(m[0][0])\n\nfor i in range(len(m)-1):\n if m[i+1][1] == most:\n answer.append(m[i+1][0])\n else:\n break\n\nfor output in sorted(answer):\n print(output)\nreturn', 'n = int(input())\np = [input() for i in range(n)]\n\nc = collections.Counter(p)\nm = c.most_common()\nmost = m[0][1]\n\nanswer = []\n\nanswer.append(m[0][0])\n\nfor i in range(len(m)-1):\n if m[i+1][1] == most:\n answer.append(m[i+1][0])\n else:\n break\n\nfor output in sorted(answer):\n print(output)', 'import collections\n\nn = int(input())\np = [input() for i in range(n)]\n\nc = collections.Counter(p)\nm = c.most_common()\nmost = m[0][1]\n\nanswer = []\n\nanswer.append(m[0][0])\n\nfor i in range(len(m)-1):\n if m[i+1][1] == most:\n answer.append(m[i+1][0])\n else:\n break\n\nfor output in sorted(answer):\n print(output)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s422407909', 's776089462', 's581940165'] | [3064.0, 17052.0, 49204.0] | [17.0, 274.0, 723.0] | [334, 307, 327] |
p02773 | u620238824 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nS = list(input() for i in range(N)) \n\nA = {}\nfor i in S:\n A.setdefault(i, 1)\n A[i] += 1\n\nB = max(A.values())\nC = [i for i in A if A[i] == B]\nC = sorted(C)\nprint(C)', 'N = int(input())\nS = list(input() for i in range(N)) \nS = sorted(S)\n\nimport collections\nA = collections.Counter(S)\n\nmax_k_list = [kv[0] for kv in A.items() if kv[1] == max(A.values())]\nprint(max_k_list)', 'N = int(input())\nS = list(input() for i in range(N)) \n\nimport collections\nA = collections.Counter(S)\n\nB = max(A.values())\nC = [i for i in A.keys() if A[i] == B]\nC = sorted(C)\n\nfor i in C:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s391176411', 's897892917', 's727088414'] | [38936.0, 38452.0, 35604.0] | [593.0, 2105.0, 722.0] | [227, 243, 241] |
p02773 | u620846115 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nN=int(input())\ns=[str(input()) for i in range(N)]\nc=collections.Counter(s)\nmax_c_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]\nprint(sorted(max_c_list))', 'import collections\nN=int(input())\ns=[str(input()) for i in range(N)]\nc=collections.Counter(s)\nmaximum =max(c.values()) \nmax_c_list = soreted(key for key,value in c.items() if value == maximum)\nfor s in max_c_list:\n print(s)', 'import collections\nN=int(input())\ns=[str(input()) for i in range(N)]\nc=collections.Counter(s)\nmaximum =max(c.values()) \nmax_c_list = sorted(key for key,value in c.items() if value == maximum)\nfor s in max_c_list:\n print(s)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s318593235', 's864447684', 's409673963'] | [38868.0, 38780.0, 38552.0] | [2206.0, 289.0, 429.0] | [188, 224, 223] |
p02773 | u622847899 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\ns=[input() for _ in range(n)]\n\n\n\ncount={}\nfor i in range(n):\n if s[i] not in count:\n count[s[i]] = 1\n else:\n count[s[i]] += 1\n\nans = [k for k,v in count.items() if v == max(count.values())]\nfor i in range(len(ans)):\n print(ans[i])\n', 'n=int(input())\ns=[input() for _ in range(n)]\n \n \n \ncount={}\nfor i in range(n):\n if s[i] not in count:\n count[s[i]] = 1\n else:\n count[s[i]] += 1\n \nmax = max(count.values())\n\n#for word in count:\n# if count[word] == max:\n# ans.append(word)\nans = [k for k,v in count.items() if v == max]\nans.sort()\nfor i in ans:\n print(i)\n'] | ['Wrong Answer', 'Accepted'] | ['s163847841', 's234218075'] | [35220.0, 35336.0] | [2105.0, 700.0] | [269, 361] |
p02773 | u624613992 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nn = int(input())\ns = [input() for _ in range(n)]\nword = collections.Counter(s)\nword = word.most_common()\nmax_num = word[0][1]\nfor i in range(len(word)):\n if word[i][1] == max_num:\n print(word[i][0])\n else:\n exit()', 'import collections\nn = int(input())\ns = [input() for _ in range(n)]\nword = collections.Counter(s)\nword = word.most_common()\nmax_num = word[0][1]\nword.sort()\nfor i in range(len(word)):\n if word[i][1] == max_num:\n print(word[i][0])\n else:\n exit()', 'import collections\nn = int(input())\ns = [input() for _ in range(n)]\nword = collections.Counter(s)\nword = word.most_common()\nword.sort()\nmax_num = word[0][1]\nfor i in range(len(word)):\n if word[i][1] == max_num:\n print(word[i][0])', 'from collections import Counter\n\nN = int(input())\nS = []\nfor i in range(N):\n S.append(input())\nS.sort()\nc = Counter(S).most_common()\nm = c[0][1]\nc.sort()\nfor i in range(len(c)):\n if c[i][1] == m:\n print(c[i][0])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s055781272', 's070875867', 's183037912', 's759671763'] | [45044.0, 45040.0, 45040.0, 45084.0] | [533.0, 825.0, 893.0, 1100.0] | [252, 264, 239, 224] |
p02773 | u624617831 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import collections\n\ndef main():\n n = int(input())\n\n s_list = []\n\n for i in range(n):\n s = str(input())\n s_list.append(s)\n\n c = collections.Counter(s_list)\n c_list = c.most_common()\n\n print_count = len(c_list)\n for j in range(len(c_list)-1):\n if c_list[j+1][1] < c_list[j][1]:\n print_count = j+1\n break\n \n for k in range(print_count):\n print(c_list[k][0])\n \n\nif __name__ == '__main__':\n main()\n\n", "import collections\n\ndef main():\n n = int(input())\n\n s_list = []\n\n for i in range(n):\n s = str(input())\n s_list.append(s)\n\n c = collections.Counter(s_list)\n c_list = c.most_common()\n\n print_count = len(c_list)\n new_list = []\n\n for j in range(len(c_list)):\n new_list.append(c_list[j][0])\n if j != len(c_list)-1:\n if c_list[j+1][1] < c_list[j][1]:\n print_count = j+1\n break\n \n sorted_list = sorted(new_list)\n for k in sorted_list:\n print(k)\n \n\nif __name__ == '__main__':\n main()\n\n"] | ['Wrong Answer', 'Accepted'] | ['s699261065', 's570749358'] | [46888.0, 49208.0] | [594.0, 751.0] | [477, 592] |
p02773 | u627803856 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\ns=[input() for i in range(n)]\nd={}\nfor i in range(n):\n d[s[i]] = d.get(s[i],0) + 1\n\nmax_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]\nmax_k_list.sort()\nprint(*max_k_list)', 'n = int(input())\nd = {}\nfor _ in range(n):\n s = input()\n d[s] = d.get(s, 0) + 1\n\nsorted_d = sorted(d.items(), key=lambda x:x[1], reverse=True)\nma = sorted_d[0][1]\n\nres = []\n\nfor i in range(len(sorted_d)):\n if sorted_d[i][1] == ma:\n res.append(sorted_d[i][0])\n\nres.sort()\n\nfor i in range(len(res)):\n print(res[i])'] | ['Time Limit Exceeded', 'Accepted'] | ['s586833787', 's500906671'] | [35220.0, 45788.0] | [2105.0, 771.0] | [205, 331] |
p02773 | u628581330 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ns = list(input().split())\ndic ={}\nfor key in s:\n if key not in dic:\n count = 1\n dic[key] = count\n count = count+1\nres = sorted(list(filter(lambda key:dic[key]==max(dic.values()),list(dic))))\nfor key in res:\n print(key)', 'n = int(input())\ndic ={}\nfor i in range(n):\n key = input()\n if key not in dic:\n dic[key] = 1\n if key in dic:\n dic[key] += 1\nmax_v = max(dic.values())\nres = sorted(list(filter(lambda key:dic[key]==max_v,list(dic))))\nfor key in res:\n print(key)'] | ['Wrong Answer', 'Accepted'] | ['s509051700', 's824497464'] | [3060.0, 33112.0] | [17.0, 831.0] | [254, 268] |
p02773 | u629560745 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\ndic = {}\ns = []\nfor _ in range(N):\n s.append(input())\n\nfor i in s:\n if i in dic.keys():\n dic[i] += 1\n else:\n dic[i] = 1\nresult = []\nnum = 0\nfor i in dic.keys():\n if dic[i] > num:\n result = []\n result.append(i)\n num = dic[i]\n elif dic[i] == num:\n result.append(i)\nfor i in result:\n print(i)', 'N = int(input())\ndic = {}\ns = []\nfor _ in range(N):\n s.append(input())\n\nfor i in s:\n if i in dic.keys():\n dic[i] += 1\n else:\n dic[i] = 1\nresult = []\nnum = 0\nfor i in dic.keys():\n if dic[i] > num:\n result = []\n result.append(i)\n num = dic[i]\n elif dic[i] == num:\n result.append(i)\nresult.sort()\nfor i in result:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s092574700', 's345349432'] | [35216.0, 35216.0] | [523.0, 708.0] | [365, 379] |
p02773 | u629607744 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['def i():\n\treturn int(input())\ndef i2():\n\treturn map(int,input().split())\ndef s():\n\treturn str(input())\ndef l():\n\treturn list(input())\ndef intl():\n\treturn list(int(k) for k in input().split())\n\nn = i()\n#s = {s():0 for _ in range(n)}\n\na = {}\nfor i in range(n):\n\ts = input()\n\ttry:\n\t\ta[s] += 1\n\texcept KeyError:\n\t\ta[s] = 1\nb = sorted(a.items(),key = lambda x:x[0])\nprint(a)\nmemo = max(b)[1]\nfor i in b:\n\t"""print(i,"i")\n\tprint(i[0],"i[0]")\n\tprint(i[1],"i[1]")\n\tprint(max(b)[0],"max(b)[0]")"""\n\tif i[1] == memo:\n\t\tprint(i[0])', 'n=int(input())\na=[str() for i in range(n)]\nb=[]\nfor j in range(n):\n for k in range(n):\n if a[j]==a[k]:\n b=a[j]\nb.sort()\nprint(b)', 'def i():\n\treturn int(input())\ndef i2():\n\treturn map(int,input().split())\ndef s():\n\treturn str(input())\ndef l():\n\treturn list(input())\ndef intl():\n\treturn list(int(k) for k in input().split())\n\nn = i()\n#s = {s():0 for _ in range(n)}\n\na = {}\nfor i in range(n):\n\ts = input()\n\ttry:\n\t\ta[s] += 1\n\texcept KeyError:\n\t\ta[s] = 1\nb = sorted(a.items(),key = lambda x:x[0])\n\nmemo = max([i[1] for i in a.items()])\nfor i in b:\n\t"""print(i,"i")\n\tprint(i[0],"i[0]")\n\tprint(i[1],"i[1]")\n\tprint(max(b)[0],"max(b)[0]")"""\n\tif i[1] == memo:\n\t\tprint(i[0])\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s226762979', 's678662346', 's936280653'] | [51564.0, 4656.0, 48836.0] | [664.0, 2104.0, 563.0] | [520, 137, 534] |
p02773 | u630554891 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn=int(input())\ns = []\nmax = 0\n\nfor i in range(n):\n s.append(input())\n\nc = collections.Counter(s)\n\nfor i in c.items():\n if i[1] > max:\n max = i[1]\n\ns2 = [i[0] for i in c.items() if i[1] == max]\n\nfor j in range(len(s2)):\n print(s2[j])', 'import collections\n\nn=int(input())\ns = []\nmax = 0\n\nfor i in range(n):\n s.append(input())\n\nc = collections.Counter(s)\n\nfor i in c.items():\n if i[1] > max:\n max = i[1]\n\ns2 = [i[0] for i in c.items() if i[1] == max]\n\ns2.sort()\n\nfor j in range(len(s2)):\n print(s2[j])\n\n'] | ['Wrong Answer', 'Accepted'] | ['s050320339', 's900820609'] | [35572.0, 35572.0] | [596.0, 727.0] | [268, 281] |
p02773 | u631525844 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nnum = int(input())\nvalue = [input() for i in range(num)]\nvotes = Counter(value)\ndict = {}\n\nfor value in votes.values():\n dict[value] = []\n\nfor (key, value) in votes.iteritems():\n dict[value].append(key)\nmaxVote = sorted(dict.keys(), reverse=True)[0]\nif len(dict[maxVote]) > 1:\n print(sorted(dict[maxVote])[0])\nelse:\n print(dict[maxVote][0])', 'from collections import Counter\nnum = int(input())\nvalue = [input() for i in range(num)]\nprint(type(value))\nvotes = Counter(value)\ndict = {}\n\nfor value in votes.values():\n dict[value] = []\n\nfor (key, value) in votes.items():\n dict[value].append(key)\nmaxVote = sorted(dict.keys(), reverse=True)[0]\nif len(dict[maxVote]) > 1:\n print(sorted(dict[maxVote])[0])\nelse:\n print(dict[maxVote][0])', 'from collections import Counter\nnum = int(input())\nvalue = [input() for i in range(num)]\nvotes = Counter(value)\ndict = {}\n\nfor value in votes.values():\n dict[value] = []\n\nfor (key, value) in votes.items():\n dict[value].append(key)\nmaxVote = sorted(dict.keys(), reverse=True)[0]\nlist_data = dict[maxVote]\nlist_data.sort()\nfor i in list_data:\n print(i)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s531622135', 's944340690', 's800149689'] | [35568.0, 35572.0, 35564.0] | [335.0, 529.0, 628.0] | [384, 399, 359] |
p02773 | u634079249 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import sys\nimport os\nimport math\n\nii = lambda: int(sys.stdin.buffer.readline().rstrip())\nil = lambda: list(map(int, sys.stdin.buffer.readline().split()))\nfl = lambda: list(map(float, sys.stdin.buffer.readline().split()))\niln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]\n\niss = lambda: sys.stdin.buffer.readline().decode().rstrip()\nsl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))\nisn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]\n\nMOD = 10 ** 9 + 7\n\n\ndef main():\n if os.getenv("LOCAL"):\n sys.stdin = open("input.txt", "r")\n\n N = ii()\n ret = 0\n di = {}\n mx = 0\n for n in range(N):\n s = iss()\n if s in di:\n di[s] += 1\n mx = max(di[s], mx)\n else:\n di[s] = 0\n\n for s in di:\n if di[s] == mx: print(s)\n\n\nif __name__ == \'__main__\':\n main()\n', 'import sys\nimport os\nimport math\n\nii = lambda: int(sys.stdin.buffer.readline().rstrip())\nil = lambda: list(map(int, sys.stdin.buffer.readline().split()))\nfl = lambda: list(map(float, sys.stdin.buffer.readline().split()))\niln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]\n\niss = lambda: sys.stdin.buffer.readline().decode().rstrip()\nsl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))\nisn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]\n\nMOD = 10 ** 9 + 7\n\n\ndef main():\n if os.getenv("LOCAL"):\n sys.stdin = open("input.txt", "r")\n\n N = ii()\n S = [iss() for _ in range(N)]\n S.sort()\n di = {}\n mx = 0\n for s in S:\n if s in di:\n di[s] += 1\n mx = max(di[s], mx)\n else:\n di[s] = 0\n\n ret = []\n for s in di:\n if di[s] == mx: ret.append(s)\n print(*sorted(ret), sep=\'\\n\')\n\n\nif __name__ == \'__main__\':\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s950942575', 's203593863'] | [32100.0, 35608.0] | [327.0, 643.0] | [911, 973] |
p02773 | u639340617 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\ns = [input() for i in range(n)]\n\nc = collections.Counter(s)\ncommon = c.most_common()\n\ncount = common[0][1]\n\nfor i in common:\n if i[1] == count:\n print(i[0])\n else:\n break\n \n', "from collections import Counter\n\nn = int(input())\ns = [input() for i in range(n)]\nc = Counter(s)\nc.most_common()\nans = []\nm = -1\nfor i, item in enumerate(c.most_common()):\n if i == 0:\n m = item[1]\n ans.append(item[0])\n elif item[1] == m:\n ans.append(item[0])\n else:\n break\nans.sort()\nprint(*ans, sep='\\n')\n"] | ['Wrong Answer', 'Accepted'] | ['s599864276', 's779429164'] | [46860.0, 45028.0] | [508.0, 732.0] | [219, 343] |
p02773 | u639592190 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\n \nS_set = list(set(S))\nS_dic = {}\nM = 0\nfor s in S_set:\n S_dic[s] = S.count(s)\n M = max(M, S.count(s))\n \nS_dic_sorted = sorted(S_dic.items(), key=lambda x: x[0])\nfor l in S_dic_sorted:\n if l[1] == M:\n print(l[0])\n else:\n break', 'import collections\n\nN = int(input())\nS = []\nfor _ in range(N):\n S.append(input())\n\nC = collections.Counter(S).most_common()\nM = C[0][1]\n\nans = []\nfor c in C:\n if c[1] == M:\n ans.append(c[0])\n else:\n break\n\nans.sort()\nfor a in ans:\n print(a)'] | ['Wrong Answer', 'Accepted'] | ['s373344018', 's982721616'] | [29076.0, 45040.0] | [2105.0, 928.0] | [315, 266] |
p02773 | u644546699 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\ndef resolve():\n N = int(input())\n S_list = []\n for i in range(N):\n S_list.append(input())\n \n cc = collections.Counter(S_list)\n cc_list = cc.most_common()\n\n for i in cc_list:\n print(i[0])\n\n\nif __name__ == "__main__":\n resolve()', 'import collections\n\ndef resolve():\n N = int(input())\n S_list = []\n for i in range(N):\n S_list.append(input())\n \n cc = collections.Counter(S_list)\n cc_list = cc.most_common()\n\n most_num = cc_list[0][1]\n tmp_list = []\n\n for i in cc_list:\n if most_num == i[1]:\n tmp_list.append(i[0])\n else:\n break\n\n tmp_list_sorted = sorted(tmp_list)\n for tls in tmp_list_sorted:\n print(tls)\n\n\nif __name__ == "__main__":\n resolve()'] | ['Wrong Answer', 'Accepted'] | ['s593061576', 's280739404'] | [46868.0, 49232.0] | [501.0, 680.0] | [284, 498] |
p02773 | u649460320 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["if __name__ == '__main__':\n dic = dict()\n n = int(input())\n for i in range(n):\n val = input()\n if val in dic.keys():\n dic[val]+=1\n else:\n dic[val] = 1\n max_keys = max(dic.values())\n values_of_max_key = [val for val in dic if dic[val] == max_keys]\n for s in values_of_max_key:\n print(s)", "# coding: utf-8\nif __name__ == '__main__':\n dic = dict()\n n = int(input())\n for i in range(n):\n val = input()\n if val in dic.keys():\n dic[val]+=1\n else:\n dic[val]=1\n max_keys = max(dic.values())\n values_of_max_key = [val for val in dic if dic[val] == max_keys]\n for s in values_of_max_key:\n print(s)", "if __name__ == '__main__':\n dic = dict()\n n = int(input())\n for i in range(n):\n val = input()\n if val in dic.keys():\n dic[val]+=1\n else:\n dic[val] = 1\n max_keys = max(dic.values())\n values_of_max_key = [val for val in dic if dic[val] == max_keys]\n for s in values_of_max_key:\n print(s)", "# coding: utf-8\nif __name__ == '__main__':\n dic = dict()\n n = int(input())\n for i in range(n):\n val = input()\n if val in dic.keys():\n dic[val]+=1\n else:\n dic[val]=1\n max_keys = max(dic.values())\n values_of_max_key = [val for val in dic if dic[val] == max_keys]\n sorted_values_of_max_key = sorted(values_of_max_key)\n for s in sorted_values_of_max_key:\n print(s)"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s506427051', 's762105055', 's796930997', 's497212318'] | [32096.0, 32096.0, 32096.0, 32988.0] | [501.0, 532.0, 516.0, 662.0] | [353, 367, 353, 431] |
p02773 | u652569315 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nn=int(input())\nl=[input() for i in range(n)]\nc = collections.Counter(l)\nll=len(c)\nfor i in range(ll):\n print(c.most_common()[i][0])\n\n', 'n=int(input())\nl=[input() for i in range(n)]\nl.sort()\nll=list(set(l))\nll.sort()\nm=len(ll)\nans=[0]*m\ncount=0\nj=0\nfor i in range(len(l)-1):\n if l[i]==l[i+1]:\n count+=1\n if i+1==n-1:\n ans[j]+=count\n else:\n ans[j]+=count\n count=0\n j+=1\ng=max(ans)\nfor i in range(m):\n if ans[i]==g:\n print(ll[i])\n '] | ['Wrong Answer', 'Accepted'] | ['s349859815', 's454542314'] | [45040.0, 29628.0] | [2106.0, 807.0] | [153, 319] |
p02773 | u652656291 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nd = {}\nfor _ in range(n):\n s = input()\n if s in d:\n d[s] = +1\n else:\n d[s] = 1\nmax_d = max(d.values())\nans = sorted([a[0] for i in d.items() if a[1] == max_d])\nprint(ans)', "n = int(input())\nd = {}\nfor _ in range(n):\n s = input()\n if s in d:\n d[s] = +1\n else:\n d[s] = 1\nmax_d = max(d.values())\nans = [kv[0] for kv in d.items() if kv[1] == max_d]\nans.sort()\n\nprint(*ans, sep='\\n')", 'n = int(input())\nd = {}\nfor _ in range(n):\n s = input()\n if s in d:\n d[s] = +1\n else:\n d[s] = 1\nmax_d = max(d.values())\nans = d.sorted([kv[0] for kv in d.items() if kv[1] == max_d])\nprint(ans)', 'n = int(input())\ns = [input() for _ in range(n)]\ndic = {}\nfor i in range(n):\n if s[i] not in dic:\n dic[s[i]] = 1\n else:\n dic[s[i]] += 1\nmax_dic_val = max(dic.values()) \nans = []\nfor keys in dic.keys():\n if dic[keys] == max_dic_val: \n ans.append(keys)\nans = sorted(ans)\nfor words in ans:\n print(words)', 'n = int(input())\nd = {}\nfor _ in range(n):\n s = input()\n if s in d:\n d[s] = +1\n else:\n d[s] = 1\nmax_d = max(d.values())\nans = sorted([kv[0] for kv in d.items() if kv[1] == max_d])\nprint(ans)\n', 'n=int(input())\ns=[input() for _ in range(n)]\ndic={}\nfor i in range(n):\n if s[i] not in dic:\n dic[s[i]]=1\n else:\n dic[s[i]]+=1\nlargest=max(dic.values())\nans=[]\nfor keys in dic.keys():\n if dic[keys]==largest:\n ans.append(keys)\nans=sorted(ans)\nfor words in ans:\n print(words)\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s152477984', 's233610145', 's337828921', 's822260234', 's938906104', 's624004115'] | [32096.0, 34012.0, 32096.0, 3060.0, 37464.0, 35220.0] | [338.0, 603.0, 345.0, 18.0, 570.0, 702.0] | [210, 229, 216, 317, 215, 286] |
p02773 | u653971946 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nimport sys\n\nN = int(input())\nS = [input() for _ in range(N)]\n# print(S)\n\nc = collections.Counter(S)\n# print(c.most_common())\n\noutputs = []\nfor i, (key, value) in enumerate(c.most_common()):\n outputs.append(key)\n if not (i == len(c.most_common())-1 and c.most_common()[i+1][1] == value):\n break\nfor x in reversed(outputs):\n print(x)\n ', 'N = int(input())\nS = [input() for _ in range(N)]\nS.sort()\n\nans = []\ncounter = 1\nmemo = 0\n\nfor i in range(1, N):\n if S[i] == S[i-1]:\n counter += 1\n else:\n if counter == memo:\n ans.append(S[i-1])\n elif counter > memo:\n ans.clear()\n ans.append(S[i-1])\n memo = counter\n counter = 1\nif counter == memo:\n ans.append(S[N-1])\nelif counter > memo:\n ans.clear()\n ans.append(S[N-1])\n memo = counter\nfor a in ans:\n print(a)'] | ['Runtime Error', 'Accepted'] | ['s745681258', 's850365278'] | [59368.0, 20676.0] | [476.0, 585.0] | [371, 504] |
p02773 | u655663334 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\n\nd = {}\n\nfor i in range(N):\n s = input()\n if s in d:\n d[s] = d[s] + 1\n else:\n d[s] = 1\n\nhoge = max(d.values)\n\nmax_kv_list = [kv[0] for kv in d.items() if kv[1] == hoge]\n\nmax_kv_list = sorted(max_kv_list)\nfor ans in max_kv_list:\n print(ans)', 'N = int(input())\n\nd = {}\n\nfor i in range(N):\n s = input()\n if s in d:\n d[s] = d[s] + 1\n else:\n d[s] = 1\n\nhoge = max(d.values())\n\nmax_kv_list = [kv[0] for kv in d.items() if kv[1] == hoge]\n\nmax_kv_list = sorted(max_kv_list)\nfor ans in max_kv_list:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s707363665', 's189826256'] | [32096.0, 33112.0] | [356.0, 658.0] | [282, 284] |
p02773 | u658325491 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\ns = [input() for i in range(n)]\nc = collections.Counter(s)\n\n\nprint(c.most_common()[0][0])\nfor i in range(1, len(c)):\n if c.most_common()[i][1] == c.most_common()[i-1][1]:\n print(c.most_common()[i][0])\n else:\n break\n', 'n = int(input())\n\nd = {}\nfor i in range(n):\n s = input()\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nlist = []\nmaxnum = max(d.values())\n\nfor i in d:\n if d[i] == maxnum:\n list.append(i)\nlist.sort()\nfor i in list:\n print(i)\n'] | ['Wrong Answer', 'Accepted'] | ['s657046074', 's621972956'] | [45164.0, 32096.0] | [2105.0, 641.0] | [272, 255] |
p02773 | u658987783 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\nx={}\n\ncount=0\nfor i in range(n):\n s=input()\n if s in x:\n x[s]+=1\n else:\n x[s]=1\na=max(x.values())\nanswer=sorted(x)\nfor a in answer:\n print(a)\n\n', 'n=int(input())\nx={}\n\ncount=0\nfor i in range(n):\n s=input()\n if s in x:\n x[s]+=1\n else:\n x[s]=1\n\na=max(x.values())\nkeys=[k for k,v in x.items() if v==a]\nanswer=sorted(keys)\n \nfor a in answer:\n print(a)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s816855511', 's564593135'] | [32096.0, 32988.0] | [582.0, 653.0] | [168, 213] |
p02773 | u661439250 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\nans = {}\nfor i in s:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\nprint(ans)\nans2 = sorted(ans.items(), key=lambda x:x[1], reverse=True)\nprint(ans2)\nans_list = {ans2[0][0]}\nans_cnt = ans2[0][1]\nfor i, j in ans2:\n if ans_cnt == j:\n ans_list.add(i)\n\nans_list2 = list(ans_list)\nans_list2.sort(reverse=False)\nfor i in ans_list2:\n print(i)', 'n = int(input())\ns = []\nfor i in range(n):\n s.append(input())\nans = {}\nfor i in s:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\nans2 = sorted(ans.items(), key=lambda x:x[1], reverse=True)\nans_list = {ans2[0][0]}\nans_cnt = ans2[0][1]\nfor i, j in ans2:\n if ans_cnt == j:\n ans_list.add(i)\n\nans_list2 = list(ans_list)\nans_list2.sort(reverse=False)\nfor i in ans_list2:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s832844197', 's186547688'] | [69388.0, 60020.0] | [971.0, 749.0] | [434, 410] |
p02773 | u661580140 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nN = int(input())\nS = [input() for i in range(N)]\n\nsetted_S = set(S)\ncounted_S = collections.Counter(S)\n\nans_ls = []\nfor k, v in counted_S.items():\n if v == max(counted_S.values()):\n ans_ls.append(k)\n else:\n break\n\nans_ls.sort()\n\nfor i in ans_ls:\n print(i)', 'import collections\n\nN = int(input())\nS = [input() for i in range(N)]\n\nsetted_S = set(S)\ncounted_S = collections.Counter(S)\nsorted_S = sorted(counted_S.items(), key=lambda x: x[1], reverse=True)\n\nans_ls = []\nfor s in sorted_S:\n a = sorted_S[0][1]\n if s[1] == a:\n ans_ls.append(s[0])\n else:\n break\n\nans_ls.sort()\n\nfor i in ans_ls:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s797003976', 's583417756'] | [49776.0, 58096.0] | [2105.0, 797.0] | [298, 364] |
p02773 | u663438907 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nS = []\nfor i in range(N):\n S.append(str(input()))\n \nfrom collections import Counter\nN = int(input())\nS = []\nfor i in range(N):\n S.append(str(input()))\nans_list = []\n \n\nc = Counter(S)\nkeys, values = zip(*c.most_common())\n\nfor i in range(len(values)):\n if max(values) == values[i]:\n ans_list.append(keys[i])\n \nsorted(ans_list)\nfor i in range(len(ans_list)):\n print(ans_list[i])\n\n', 'from collections import Counter\nN = int(input())\nS = []\nfor i in range(N):\n S.append(str(input()))\nans_list = []\n \n\nc = Counter(S)\nkeys, values = zip(*c.most_common())\n\nfor i in range(len(values)):\n if max(values) == values[i]:\n ans_list.append(keys[i])\n \nsorted(ans_list)\nfor i in range(len(ans_list)):\n print(ans_list[i])\n\n', 'from collections import Counter\nN = int(input())\nS = []\nfor i in range(N):\n S.append(str(input()))\n\nc = Counter(S)\nmax_value = max(list(c.values()))\nans_list = sorted(list(c.items()))\n\nfor i in range(len(ans_list)):\n if ans_list[i][1] == max_value:\n print(ans_list[i][0])'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s735936818', 's783718701', 's758522477'] | [17308.0, 59500.0, 47636.0] | [344.0, 2105.0, 977.0] | [406, 335, 276] |
p02773 | u666195238 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ndict = {}\nfor i in range(n):\n a = input()\n if (not (a in list)):\n dict[a] = 0\n else:\n dict[a] += 1\nb = max(dict.values())\nfor i in dict.keys():\n if dict[i] == b:\n print(i+"\\n")\n ', 'n = int(input())\ndict = {}\nfor i in range(n):\n a = input()\n if (not (a in dict.keys())):\n dict[a] = 1\n else:\n dict[a] += 1\nb = max(dict.values())\nlist = []\nfor i in dict.keys():\n if dict[i] == b:\n list.append(i)\nlist.sort()\nfor i in list:\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s903635936', 's945431293'] | [3060.0, 32096.0] | [17.0, 706.0] | [209, 262] |
p02773 | u671239754 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nfrom collections import Counter\nn=int(input())\nstring_list=[input() for i in range(n)]\nc = collections.Counter(string_list)\nmax = c.most_common()[0][1]\nfor i in c.items():\n if i[1] == max:\n print(i[0])\n', 'import collections\nfrom collections import Counter\nn=int(input())\nstring_list=[input() for i in range(n)]\nc = collections.Counter(string_list)\nmax = c.most_common()[0][1]\nlist = []\n# print("-------")\nfor i in c.items():\n if i[1] == max:\n list.append(i[0])\n\nfor i in sorted(list):\n print(i)\n'] | ['Wrong Answer', 'Accepted'] | ['s579712582', 's148973443'] | [45032.0, 45028.0] | [541.0, 745.0] | [231, 303] |
p02773 | u672316981 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ns_lst = [str(input()) for i in range(n)]\ns_lst.sort()\n\ncount_lst = []\ncount = 1\n\nif n==1:\n count_lst.append(1)\nelse:\n for i in range(1,n):\n s1 = s_lst[i-1]\n s2 = s_lst[i]\n\n if s1==s2:\n count += 1\n if i==n-1:\n count_lst.append(count)\n else:\n count_lst.append(count)\n count = 1\n\n if s_lst[-1]!=s_lst[-2]:\n count_lst.append(1)\n\n\nnew_slst = list(set(s_lst))\nmax_count = max(count_lst)\nanswer_lst = []\n\nfor i in range(len(count_lst)):\n cou = count_lst[i]\n s = new_slst[i]\n if cou==max_count:\n answer_lst.append(s)\n\nanswer_lst.sort()\nfor i in range(len(answer_lst)):\n answer = answer_lst[i]\n print(answer)', 'n = int(input())\ns_lst = [str(input()) for i in range(n)]\ns_lst.sort()\n\ncount_lst = []\ncount = 1\nfor i in range(n-1):\n s1 = s_lst[i]\n s2 = s_lst[i+1]\n\n if s1==s2:\n count += 1\n if i==n-2:\n count_lst.append(count)\n else:\n count_lst.append(count)\n count = 1\n\nif n>1:\n if s_lst[-1]!=s_lst[-2]:\n count_lst.append(1)\nif n==1:\n count_lst.append(1)\n\nnew_slst = list(set(s_lst))\nmax_count = max(count_lst)\nanswer_lst = []\n\nfor i in range(len(count_lst)):\n cou = count_lst[i]\n s = new_slst[i]\n if cou==max_count:\n answer_lst.append(s)\n\nanswer_lst.sort()\nfor i in range(len(answer_lst)):\n answer = answer_lst[i]\n print(answer)', 'n = int(input())\ns_lst = [str(input()) for i in range(n)]\ns_lst.sort()\n\ncount_lst = []\ncount = 1\n\nif n==1:\n count_lst.append(1)\nelse:\n for i in range(1,n):\n s1 = s_lst[i-1]\n s2 = s_lst[i]\n\n if s1==s2:\n count += 1\n if i==n-1:\n count_lst.append(count)\n else:\n count_lst.append(count)\n count = 1\n\n if s_lst[-1]!=s_lst[-2]:\n count_lst.append(1)\n\n\nnew_slst = list(set(s_lst))\nnew_slst.sort()\nmax_count = max(count_lst)\nanswer_lst = []\n\nfor i in range(len(count_lst)):\n cou = count_lst[i]\n s = new_slst[i]\n if cou==max_count:\n answer_lst.append(s)\n\nanswer_lst.sort()\nfor i in range(len(answer_lst)):\n answer = answer_lst[i]\n print(answer)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s157822904', 's943434477', 's637492019'] | [31164.0, 31172.0, 31172.0] | [943.0, 934.0, 1015.0] | [741, 701, 757] |
p02773 | u672882146 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import itertools\nn=int(input())\ns = []\nfor _ in range(n):\n s.append(input())\n#print(s)\n#s = list(itertools.chain.from_iterable(s))\n#print(s)\ns_u = list(set(s))\nbox = []\nbox.append([s_u[0],s.count(s_u[0])])\nfor i in range(1,len(s_u)):\n if max(box) < s.count(s_u[i]):\n box.remove(max(box))\n box.append([s_u[i],s.count(s_u[i])])\n elif max(box) == s.count(s_u[i]):\n box.append([s_u[i],s.count(s_u[i])])\n \nans_box = sorted(box)\nfor i in range(len(ans_box)):\n print(ans_box[i])', 'n=int(input())\ndic = dict()\n\na = 0\nfor i in range(n):\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n if dic[s] > a:\n a = dic[s]\nbox= []\nfor i in dic:\n if dic[i] == a:\n box.append(i)\n\nans = sorted(box)\nfor in in range(len(ans)):\n print(ans)', 'n=int(input())\ndic = dict()\n\na = 0\nfor i in range(n):\n s = str(input())\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n if dic[s] > a:\n a = dic[s]\nbox= []\nfor i in dic:\n if dic[i] == a:\n box.append(i)\n\nans = sorted(box)\nfor i in range(len(ans)):\n print(ans[i])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s245527483', 's994258538', 's863431581'] | [29096.0, 2940.0, 32988.0] | [324.0, 17.0, 781.0] | [515, 282, 305] |
p02773 | u673361376 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\ncnt_s = {}\nfor _ in range(N):\n s = input()\n if s in cnt_s:\n cnt_s[s] += 1\n else:\n cnt_s[s] - 1\n \nmax_cnt = max(cnt_s.values())\n\nans = []\nfor key, value in cnt_s.items():\n if value == max_cnt:\n ans.append(key)\n \n[print(s) for s in sorted(ans)]', 'N = int(input())\ncnt_s = {}\nfor _ in range(N):\n s = input()\n if s in cnt_s:\n cnt_s[s] += 1\n else:\n cnt_s[s] = 1\n \nmax_cnt = max(cnt_s.values())\n\nans = []\nfor key, value in cnt_s.items():\n if value == max_cnt:\n ans.append(key)\n \n[print(s) for s in sorted(ans)]\n'] | ['Runtime Error', 'Accepted'] | ['s310909113', 's933107197'] | [3064.0, 34012.0] | [17.0, 662.0] | [274, 275] |
p02773 | u674588203 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\n\nN=int(input())\nS=[]\n\nfor _ in range(N):\n s=input()\n S.append(s)\n\nc=Counter(S)\n\nmax_s_list= [kv[0] for kv in c.items() if kv[1]==max(c.values())]\n\nans=sorted(max_s_list)\nfor a in max_s_list:\n print(a)', 'from collections import OrderedDict\n\nN=int(input())\nS=[]\n\nfor _ in range(N):\n s=input()\n S.append(s)\n\nc=OrderedDict(sorted(S))\n\nmax_s_list= [kv[0] for kv in c.items() if kv[1]==max(c.values())]\n\nfor a in max_s_list:\n print(a)', 'N=int(input())\nSarr1=[]\nSarr2=[]\nfor _ in range(N):\n s=input()\n if Sarr1.count(s)==0:\n Sarr1.append(s)\n Sarr2.append(0)\n if Sarr1.count(s)>0:\n i =Sarr1.index(s)\n Sarr2[i]+=1\nans=[]\nfor i in range(len(Sarr2)):\n if Sarr2[i]==max(Sarr2):\n ans.append(Sarr1[i])\n else:\n pass\nFA=sorted(ans)\nprint(FA)', 'import collections\n\nN=int(input())\nS=[]\nfor _ in range(N):\n s=input()\n S.append(s)\n\nc=collections.Counter(S)\n\nmax_s_list= [kv[0] for kv in c.items() if kv[1]==max(c.values())]\n\nfor l in max_s_list:\n print(l)', 'N=int(input())\nSarr=[]\nfor _ in range(N):\n s=input()\n Sarr.append(s)\n\n_Sset1=set(Sarr)\n_Sset2=list(_Sset1)\nSset=sorted(_Sset2)\n\nSsetcount=[]\nfor i in range(len(Sset)):\n c=Sarr.count(Sset[i])\n Ssetcount.append(c)\n\nmaxnum=max(Ssetcount)\nansindex=[]\nfor j in range(len(Ssetcount)):\n if Ssetcount[j]==maxnum:\n ansindex.append(j)\n else:\n pass\nans=[]\nfor k in range(len(ansindex)):\n x=Sset[k]\n ans.append(x)\n\nprint(ans)', 'from collections import Counter\n\nN=int(input())\nS=[]\n\nfor _ in range(N):\n s=input()\n S.append(s)\n\nc=Counter(S)\narr=c.most_common()\n\nmaxnum=arr[0][1]\nans=[]\n\nfor i in range(len(arr)):\n if arr[i][1]==maxnum:\n ans.append(arr[i][0]) \n else:\n break\nFA=sorted(ans)\nfor j in FA:\n print(j)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s211407196', 's459403936', 's484436713', 's611880944', 's695615023', 's290796564'] | [35564.0, 19688.0, 3956.0, 35568.0, 29076.0, 49228.0] | [2105.0, 415.0, 2104.0, 2105.0, 2105.0, 731.0] | [241, 234, 351, 216, 451, 317] |
p02773 | u677121387 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\nc = Counter(s)\nm = max(c.values())\nans = sorted(k for k,v in c.items() if v == m)\nprint(ans)', 'from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\nc = Counter(s)\nm = max(c.values())\nans = sorted(k for k,v in c.items() if v == m)\nprint("\\n".join(ans))'] | ['Wrong Answer', 'Accepted'] | ['s642301409', 's902653253'] | [37744.0, 35952.0] | [529.0, 501.0] | [173, 184] |
p02773 | u677523557 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import sys\ninput = sys.stdin.readline\nfrom collections import Counter\n\nN = int(input())\nSs = Counter([input().rstrip() for _ in range(N)])\nm = max(Ss.values())\nfor k, v in Ss.items():\n if v == m:\n print(k)', 'import sys\ninput = sys.stdin.readline\nfrom collections import Counter\n\nN = int(input())\nSs = Counter([input().rstrip() for _ in range(N)])\nm = max(Ss.values())\nans = []\nfor k, v in Ss.items():\n if v == m:\n ans.append(k)\nans.sort()\nprint(*ans, sep="\\n")'] | ['Wrong Answer', 'Accepted'] | ['s217474646', 's818199013'] | [35564.0, 35572.0] | [278.0, 425.0] | [215, 262] |
p02773 | u678167152 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\ns_list = {}\nfor i in range(N):\n S = input()\n if S in s_list:\n s_list[S] += 1\n else:\n s_list[S] = 0\nmax = 0\nmaxs = []\nfor s,c in s_list.items():\n if c > max:\n maxs = [s]\n max = c\n elif c == max:\n maxs.append(s)\nfor m in maxs:\n print(m)', "from collections import Counter\ndef solve():\n N = int(input())\n S = [input() for _ in range(N)]\n c = Counter(S)\n M = max(c.values())\n ans = []\n for k,v in c.items():\n if v==M:\n ans.append(k)\n ans.sort()\n return ans\nprint(*solve(),sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s425786339', 's953043553'] | [32096.0, 38716.0] | [506.0, 392.0] | [272, 255] |
p02773 | u680851063 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import collections\n\nn = int(input())\nl = [input() for _ in [0] * n]\n\ncounted = collections.Counter(l)\nprint(counted)\n\n\nm = max(counted.values())\nprint(m)\n\n\nchars = [key for key, value in counted.items()\n if value == m]\n\n#chars = []\n#for key, value in counted.items():\n# if value == m:\n# chars.append(key)\n\nprint(*sorted(chars),sep='\\n')\n", "import collections\n\nn = int(input())\nl = [input() for _ in [0] * n]\n\ncounted = collections.Counter(l)\n#print(counted)\n\nm = max(counted.values()) \n\nans = []\nfor key, value in counted.items():\n if value == m:\n ans.append(key)\n\nprint(*sorted(ans),sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s928440848', 's689987605'] | [58668.0, 35936.0] | [755.0, 592.0] | [414, 274] |
p02773 | u681811488 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import collections\nimport itertools\n\na = int(input())\n\ns = [input() for i in range(a)]\n\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nl = []\n\nfor k, v in it:\n l.append(k)\n\nl = ' '.join(l)\nprint(l)", 'import collections\nimport itertools\n\na = int(input())\n\ns = [input() for i in range(a)]\n\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nprint(*(k for k, v in it))\n', 'import collections\nimport itertools\n\na = int(input())\n\ns = [input() for i in range(a)]\n\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nl = []\n\nfor k, v in it:\n l.append(k)\n\nprint(sorted(l)) \n ', 'import collections\nimport itertools\n\na = int(input())\n\ns = [input() for i in range(a)]\n\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nl = []\n\nfor k, v in it:\n l.append(k)\n\nl = sorted(l)\n \nfor i in l:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s296067867', 's358593771', 's913133461', 's897534108'] | [45032.0, 45296.0, 45040.0, 45040.0] | [523.0, 607.0, 719.0, 805.0] | [307, 271, 304, 322] |
p02773 | u684906944 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\n\ns_dic = dict()\n\nfor i in range(n):\n s = input()\n if s not in s_dic:\n s_dic[s] = 1\n else:\n s_dic[s] += 1\n\n\ns_dic_s = sorted(s_dic.items(), key= lambda x:x[1], reverse=True)\n\n# print(len(s_dic_s))\n\nm_count = max(s_dic_s)[1]\n# print(m_count)\n\nfor i in range(len(s_dic_s)):\n if s_dic_s[i][1] == m_count:\n print(s_dic_s[i][0])', 'n = int(input())\n\ns_dic = dict()\na_dic = dict()\n\nfor i in range(n):\n s = input()\n if s not in s_dic:\n s_dic[s] = 1\n else:\n s_dic[s] += 1\n\n\ns_dic_s = sorted(s_dic.items(), key= lambda x:x[1], reverse=True)\n\n# print(len(s_dic_s))\n#print(s_dic_s)\n\nm_count = s_dic_s[0][1]\n# print(m_count)\n\nmax_n = True\nj = 0\n\nwhile max_n:\n if s_dic_s[j][1] == m_count:\n a_dic[s_dic_s[j][0]] = s_dic_s[j][1]\n j += 1\n if j == len(s_dic_s):\n max_n = False\n else:\n max_n = False\n\n# print(a_dic)\na_dic_s = sorted(a_dic.items())\n \n# print(a_dic_s)\n\nfor i in range(len(a_dic_s)):\n print(a_dic_s[i][0])'] | ['Wrong Answer', 'Accepted'] | ['s624763913', 's174754795'] | [44892.0, 70756.0] | [614.0, 1063.0] | [386, 641] |
p02773 | u686989171 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\nstring_list=[input() for i in range(n)]\nimport collections\nimport numpy as np\nc = collections.Counter(string_list)\nd=c.most_common()\nx=int(d[0][1])\nz=[]\nfor i in range(len(d)):\n y=int(d[i][1])\n if x==y:\n z.append(str(d[i][0]))\n \nz.sort(reverse=True)\nfor i in range(len(z)):\n print(z[i])', 'n=int(input())\nstring_list=[input() for i in range(n)]\nimport collections\nimport numpy as np\nc = collections.Counter(string_list)\nd=c.most_common()\nx=int(d[0][1])\nfor i in range(len(d)):\n y=int(d[i][1])\n if x==y:\n print(d[i][0])\n ', 'n=int(input())\nstring_list=[input() for i in range(n)]\nimport collections\nimport numpy as np\nc = collections.Counter(string_list)\nd=c.most_common()\nx=int(d[0][1])\nz=[]\nfor i in range(len(d)):\n y=int(d[i][1])\n if x==y:\n z.append(str(d[i][0]))\n \nz.sort()\nfor i in range(len(z)):\n print(z[i])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s940861073', 's996283320', 's849227360'] | [56336.0, 55568.0, 56360.0] | [1043.0, 715.0, 925.0] | [310, 238, 298] |
p02773 | u687574784 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["n = int(input())\nfrom collections import defaultdict\nd=defaultdict(int)\nfor _ in range(n):\n d[input()]+=1\n\nL=[(v,k) for (k,v) in d.items()]\nL.sort(reverse=True)\nmax_cnt=L[0][0]\n#print('*'*30)\nans=[]\nfor l in L:\n if l[0]==max_cnt:\n ans.append(l[1])\n else :\n break\n\nfor a in ans:\n print(ans)", "n = int(input())\nfrom collections import defaultdict\nd=defaultdict(int)\nfor _ in range(n):\n d[input()]+=1\n\nL=[(v,k) for (k,v) in d.items()]\nL.sort(reverse=True)\nmax_cnt=L[0][0]\n#print('*'*30)\nans=[]\nfor l in L:\n if l[0]==max_cnt:\n ans.append(l[1])\n else :\n break\n\nfor a in ans:\n print(a)", 'n = int(input())\nfrom collections import defaultdict\nd=defaultdict(int)\n\nmax_cnt=-1\nfor _ in range(n):\n s=input()\n d[s]+=1\n max_cnt=max(max_cnt, d[s])\n\n\nans=sorted([k for (k,v) in d.items() if v==max_cnt])\n \nfor a in ans:\n print(a)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s137875748', 's715860185', 's610952456'] | [181592.0, 45472.0, 33404.0] | [2106.0, 978.0, 797.0] | [315, 313, 246] |
p02773 | u690781906 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\ncounter = Counter(s)\nindex = 0\nans = []\nfor k, v in counter.most_common():\n if index == 0:\n max_v = v\n ans.append(k)\n else:\n if v == max_v:\n ans.append(k)\n else:\n exit()\n index += 1\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])\n', 'from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\ncounter = Counter(s)\nindex = 0\nans = []\nfor k, v in counter.most_common():\n if index == 0:\n max_v = v\n ans.append(k)\n else:\n if v == max_v:\n ans.append(k)\n else:\n break\n index += 1\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])\n'] | ['Wrong Answer', 'Accepted'] | ['s340220017', 's909514935'] | [45040.0, 45040.0] | [806.0, 809.0] | [386, 385] |
p02773 | u690833702 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import math\nimport collections\n\ndef main():\n N = int(input())\n S = list()\n S = [input() for _ in range(N)]\n \n s = collections.counter(S)\n \n MaxCount = max(s.values())\n \n ans = []\n \n for key, value in s.items():\n if value == MaxCount:\n ans.append(key)\n \n ans.sort()\n \n for i in ans:\n print(ans[i])\n \n \n \n \nmain()', '\nimport math\nimport collections\n\ndef main():\n N = int(input())\n S = list()\n S = [input() for _ in range(N)]\n \n s = collections.Counter(S)\n \n MaxCount = max(s.values())\n \n ans = []\n \n for key, value in s.items():\n if value == MaxCount:\n ans.append(key)\n \n ans.sort()\n \n for i in ans:\n print(i)\n \n \n \n \nmain()'] | ['Runtime Error', 'Accepted'] | ['s153109257', 's465310015'] | [23512.0, 38780.0] | [234.0, 420.0] | [356, 352] |
p02773 | u691225483 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ndic = {}\nfor _ in range(n):\n k = input()\n dic[k] = 1 if k not in dic else dic[k] + 1\nresult = []\nfor i,j in dic.items():\n result.append((j,i))\n result.sort()\n maxi = result[-1][0]\n reresult=[]\n for i in result:\n if maxi == i[0]:\n reresult.append(i[1])\n for i in sorted(reresult):\n print(i)', 'n = int(input())\ndic = {}\nmaxi = 0\nfor _ in range(n):\n k = input()\n dic[k] = 1 if k not in dic else dic[k] + 1\n if dic[k] > maxi: maxi = dic[k]\nresult = []\nfor i,j in dic.items():\n if j == maxi:\n result.append(i)\nresult.sort()\nfor r in result:\n print(r)'] | ['Wrong Answer', 'Accepted'] | ['s455356780', 's140800128'] | [59476.0, 32096.0] | [2104.0, 695.0] | [333, 261] |
p02773 | u692453235 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import defaultdict\n\nN = int(input())\nS_dic = defaultdict(int)\n\nfor i in range(N):\n S = input()\n S_dic[S] += 1\n\nm = max(S_dic.values())\nmax_S = [i[0] for i in S_dic.items() if i[1] == m ]\nprint("\\n".join(max_S))', 'from collections import defaultdict\n\nN = int(input())\nS_dic = defaultdict(int)\n\nfor i in range(N):\n S = input()\n S_dic[S] += 1\n\nm = max(S_dic.values())\nmax_S = [i[0] for i in S_dic.items() if i[1] == m ]\nmax_S.sort()\nprint("\\n".join(max_S))'] | ['Wrong Answer', 'Accepted'] | ['s206264870', 's415968081'] | [34396.0, 34384.0] | [486.0, 656.0] | [229, 242] |
p02773 | u692746605 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nN=int(input())\nC=collections.Counter([input() for _ in range(N)])\nv,c=zip(*C.most_common())\nprint(v[0])\nfor i in range(1,len(v)):\n if c[0]!=c[i]:\n break\n print(v[i])\n', 'import collections\n\nN=int(input())\nC=collections.Counter([input() for _ in range(N)])\nv,c=zip(*C.most_common())\n[print(x) for x in sorted([v[i] for i in range(len(c)) if c[i]==c[0]])]\n'] | ['Wrong Answer', 'Accepted'] | ['s319697353', 's765445450'] | [57940.0, 57932.0] | [611.0, 770.0] | [191, 184] |
p02773 | u693134887 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['for _ in range(n):\n s += input()+" "\nls = s.split()\ncounter = 0\nres = []\nfor x in ls:\n if ls.count(x) > counter:\n counter = ls.count(x)\nfor x in set(ls):\n if ls.count(x) == counter:\n res.append(x)\nr = sorted(res)\nprint("\\n".join(r))', 'from collections import Counter\nn = int(input())\nls = []\nfor _ in range(n):\n ls.append(input())\nres = []\ncounter = Counter(ls).most_common()\nfor x in counter:\n if x[1] == counter[0][1]:\n res.append(x[0])\nprint("\\n".join(sorted(res)))'] | ['Runtime Error', 'Accepted'] | ['s455046696', 's945515364'] | [3064.0, 45040.0] | [18.0, 623.0] | [255, 246] |
p02773 | u693173434 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["n = int(input())\ns = [input() for i in range(n)]\n\nvote = {}\nfor i in range(n):\n if s[i] in vote:\n vote[s[i]] +=1\n else:\n vote[s[i]] = 1\nmax_kv_list = [kv[0] for kv in vote.items() if kv[1] == max(vote.values())]\nmax_kv_list.sort()\n\nprint('¥n'.join(max_kv_list))", 'from collections import defaultdict\nn = int(input())\n\nd=defaultdict(int)\nfor i in range(n):\n s=input()\n d[s]+=1\n\nmx=0\nfor i,j in d.items():\n if j>mx:\n mx=j\n\nans=[]\nfor i, j in d.items():\n if j==mx:\n ans.append(i)\n\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s166073089', 's641754959'] | [35220.0, 32480.0] | [2105.0, 755.0] | [282, 277] |
p02773 | u693933222 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\n\nl = []\n\nfor i in range(n):\n l.append(input())\nc = collections.Counter(l)\ncx = c.most_common()\nnm = cx[0][1]\nprint(cx[0][0])\nfor i in range(1, len(cx)):\n if (nm == cx[i][1]):\n print(cx[i][0])\n else:\n break', 'import collections\n\nn = int(input())\n\nl = []\n\nfor i in range(n):\n l.append(input())\nc = collections.Counter(l)\ncx = c.most_common()\nnm = cx[0][1]\nfor i in range(n):\n if (nm == cx[i][1]):\n print(cx[i][0])\n else:\n break', 'import collections\n\nn = int(input())\n\nl = []\n\nfor i in range(n):\n l.append(input())\nc = collections.Counter(l)\ncx = c.most_common()\nnm = cx[0][1]\nans = []\nans.append(cx[0][0])\nfor i in range(1, len(cx)):\n if (nm == cx[i][1]):\n ans.append(cx[i][0])\n else:\n break\n\nansx = sorted(ans)\nfor i in range(len(ans)):\n print(ansx[i])'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s257257433', 's789683332', 's719404377'] | [46864.0, 46888.0, 49240.0] | [679.0, 585.0, 888.0] | [265, 240, 349] |
p02773 | u694665829 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["box={}\nn=int(input())\nfor i in range(n):\n v=input()\n if v in box:\n box[v]+=1\n else:\n box[v]=1\nm=max(box.values())\nf=[k for k,v in box.items() if v==m]\nprint('\\n'.join(f))", "box={}\nn=int(input())\nfor i in range(n):\n v=input()\n if v in box:\n box[v]+=1\n else:\n box[v]=1\nm=max(box.values())\nf=[k for k,v in box.items() if v==m]\nf.sort()\nprint('\\n'.join(f))"] | ['Wrong Answer', 'Accepted'] | ['s156942751', 's081730332'] | [36836.0, 36692.0] | [306.0, 392.0] | [193, 202] |
p02773 | u695644361 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nn=int(input())\ns=Counter([input()for _ in[0]*n])\nm=s.most_common(1)[0][1]\nr=(k for k,v in s.items() if v==m)\nfor a in r:print(a)', 'from collections import Counter\nn=int(input())\ns=Counter([input()for _ in[0]*n])\nm=s.most_common(1)[0][1]\nr=sorted((k for k,v in s.items() if v==m))\nfor a in r:print(a)'] | ['Wrong Answer', 'Accepted'] | ['s282771433', 's881735147'] | [41208.0, 41204.0] | [339.0, 422.0] | [160, 168] |
p02773 | u697386253 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nimport itertools\nn = int(input())\ns = list(input() for i in range(n))\ns.sort()\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\nprint(it)', 'import collections\nn = int(input())\ns = list(input() for i in range(n))\ncounted = collections.Counter(s)\n\nm = max(counted.values())\nchars = [key for key, value in counted.items()\n if value == m]\nchars.sort()\nfor i in range(len(chars)):\n print(chars[i])'] | ['Wrong Answer', 'Accepted'] | ['s069108076', 's942524006'] | [45076.0, 35580.0] | [687.0, 670.0] | [262, 267] |
p02773 | u698197687 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["from collections import Counter\n\n\ndef words_sort_ordered(words_list):\n cnt = Counter()\n for word in words_list:\n cnt[word] += 1\n\n written_words_number = []\n for x in cnt.values():\n written_words_number.append(x)\n\n answer_words_list = []\n\n for word, number in dict(cnt).items():\n if number == max(written_words_number):\n answer_words_list.append(word)\n\n return sorted(answer_words_list)\n\n\nif __name__ == '__main__':\n words_num = int(input())\n words_list = [input() for i in range(words_num)]\n print(words_sort_ordered(words_list))", "from collections import Counter\n\n\ndef words_sort_ordered(words_list):\n word_cnt = Counter()\n for word in words_list:\n word_cnt[word] += 1\n\n word_written_max_time = 0\n for each_word_ct in word_cnt.values():\n if each_word_ct > word_written_max_time:\n word_written_max_time = each_word_ct\n\n answer_words_list = []\n for word, number in dict(word_cnt).items():\n if number == word_written_max_time:\n answer_words_list.append(word)\n\n return sorted(answer_words_list)\n\n\nif __name__ == '__main__':\n words_num = int(input())\n words_list = [input() for i in range(words_num)]\n for w in words_sort_ordered(words_list):\n print(w)\n"] | ['Wrong Answer', 'Accepted'] | ['s860024813', 's212691729'] | [43492.0, 43120.0] | [2105.0, 727.0] | [591, 697] |
p02773 | u699944218 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nS = [input() for _ in range(n)]\ncount = 0\nfor i in range(n-1):\n for j in range(n-1-i):\n if S[i] == S[j]:\n count += 1\nprint(count)', 'from collections import Counter\nN = int(input())\nA = [None for i in range(N)]\nfor i in range(N):\n A[i] = input()\nA = Counter(A)\nkeyA = list(A.keys())\nvaluesA = list(A.values())\nmost = max(valuesA)\n\nans = [None for _ in range(N)]\nfor i in range(len(valuesA)):\n if valuesA[i] == most:\n ans[i] = keyA[i]\nans = [a for a in ans if type(a) == str]\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Accepted'] | ['s163376957', 's969141361'] | [17056.0, 37312.0] | [2108.0, 752.0] | [155, 406] |
p02773 | u703823201 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nN = int(input())\nS = [input() for n in range(N)]\n\ncnt = collections.Counter(S)\nm = max(cnt.values())\n\nfor k, v in dict(sorted(cnt.items())):\n if v == m:\n print(k)', 'import collections\nN = int(input())\nS = [input() for n in range(N)]\n\ncnt = collections.Counter(S)\nm = max(cnt.values())\n\nans = []\nfor k, v in cnt.items():\n if v == m:\n ans.append(k)\n \nans.sort()\nfor a in ans:\n print(a)'] | ['Runtime Error', 'Accepted'] | ['s975067815', 's957401846'] | [68080.0, 35572.0] | [730.0, 646.0] | [191, 238] |
p02773 | u703950586 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nS = []\nfor _ in range(n):\n S.append(input())\n\nS.sort()\na = S[0]\nc = 0\nmoji = []\n\nfor i in S:\n if a != i:\n moji.append([c,a])\n a = i\n c = 0\n c += 1\nif c > 0:\n moji.append([c,a])\n\nmoji.sort(reverse=True)\nmaxc = moji[0][0]\nfor j in moji:\n if j[0] < maxc: break\n print (j[1])\n', 'n = int(input())\nS = []\nfor _ in range(n):\n S.append(input())\n\nS.sort()\na = S[0]\nc = 0\nmoji = []\n\nfor i in S:\n if a != i:\n moji.append([c,a])\n a = i\n c = 0\n c += 1\nif c > 0:\n moji.append([c,a])\n\nmoji.sort(reverse=True)\nmaxc = moji[0][0]\nx = []\nfor j in moji:\n if j[0] < maxc: break\n x.append(j[1])\nx.sort()\nfor j in x:\n print(j)\n'] | ['Wrong Answer', 'Accepted'] | ['s944092923', 's080945789'] | [40644.0, 41408.0] | [817.0, 864.0] | [328, 371] |
p02773 | u703969935 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nN = int(input())\nS_list = []\nfor i in range(N):\n S_list.append(input())\n\nc = collections.Counter(S_list)\n\nwords = []\ncounter = 0\n\n\nwhile(True):\n words.append(c.most_common()[counter][0])\n try:\n if c.most_common()[counter][1] == c.most_common()[counter+1][1]:\n counter += 1\n else:\n break\n except:\n break\n\nwords = sorted(words)\nprint("--")\nfor j in range(len(words)):\n print(words[j])', 'import collections\nN = int(input())\nS_list = []\nfor i in range(N):\n S_list.append(input())\n\nc = collections.Counter(S_list)\n\nd = c.most_common() \n\nkeys = [k for k, v in c.items() if v == d[0][1]]\n\nkeys = sorted(keys)\n\nfor i in keys:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s605179821', 's299695277'] | [45352.0, 49156.0] | [2106.0, 708.0] | [425, 244] |
p02773 | u704563784 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ncounts = {}\nbest = 0\nbest_words = []\nfor idx in range(n):\n string = input()\n if counts.get(string) is None: counts[string] = 1\n else: counts[string] += 1\n\n score = counts[string]\n\n if score > best:\n best = score\n best_words = [string]\n \n elif score == best:\n best_words.append(string)\n\nfor string in best_words:\n print(string)', 'n = int(input())\ncounts = {}\nbest = 0\nbest_words = []\nfor idx in range(n):\n string = input()\n if counts.get(string) is None: counts[string] = 1\n else: counts[string] += 1\n\n score = counts[string]\n\n if score > best:\n best = score\n best_words = [string]\n \n elif score == best:\n best_words.append(string)\n\nfor string in sorted(best_words):\n print(string)'] | ['Wrong Answer', 'Accepted'] | ['s389628316', 's100665794'] | [33420.0, 33416.0] | [534.0, 683.0] | [388, 396] |
p02773 | u706929073 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ns = [input() for _ in range(n)]\ns.sort()\n\ncount = {}\nfor s_i in s:\n if not s_i in count:\n count[s_i] = 0\n count[s_i] += 1\nres = sorted(zip(count.keys(), count.values()),\n key=lambda x: x[1], reverse=True)\n\nnum = res[0][1]\nres2 = []\nfor res_i in res:\n if res_i[1] != num:\n exit(0)\n res2.append(res_i[0])\n\nres2.sort()\nfor res2_i in res2:\n print(res2_i)\n', 'n = int(input())\ns = [input() for _ in range(n)]\ns.sort()\n\ncount = {}\nfor s_i in s:\n if not s_i in count:\n count[s_i] = 0\n count[s_i] += 1\nres = sorted(zip(count.keys(), count.values()),\n key=lambda x: x[1], reverse=True)\n\nnum = res[0][1]\nres2 = []\nfor res_i in res:\n if res_i[1] != num:\n break\n res2.append(res_i[0])\n\nres2.sort()\nfor res2_i in res2:\n print(res2_i)\n'] | ['Wrong Answer', 'Accepted'] | ['s102771077', 's516584966'] | [47668.0, 47752.0] | [924.0, 873.0] | [409, 407] |
p02773 | u708890186 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N=int(input())\nS=[]\nc=[]\nfor i in range(N):\n tmp=input()\n if not (tmp in S):\n S.append(tmp)\n c.append(1)\n else:\n c[S.index(tmp)]+=1\nm=max(c)\nfor i in range(len(S)):\n if c[i]==m:\n print(S[i])', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\nc=collections.Counter(S)\nif len(c.most_common())==1:\n print(c.most_common()[0][0])\nelse:\n for i in range(len(c.most_common())):\n print(c.most_common()[i][0])\n if c.most_common()[i][1] !=c.most_common()[i+1][1]:\n break', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\nc=collections.Counter(S)\nfor i in range(len(c.most_common())):\n print(c.most_common()[i][0])', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\nc=collections.Counter(S)\nmost=c.most_common()[0][1]\nif len(c)==1:\n print(c.most_common()[0][0])\nelse:\n for i in range(len(c)):\n print(c.most_common()[i][0])\n if c.most_common()[i+1][1] !=most:\n break\n', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\nc=collections.Counter(S)\nmost=c.most_comon()[0][1]\nif len(c)==1:\n print(c.most_common()[0][0])\nelse:\n for i in range(len(c)):\n print(c.most_common()[i][0])\n if c.most_common()[i+1][1] !=most:\n break\n', 'N=int(input())\nS=[]\nc=[]\nfor i in range(N):\n tmp=input()\n if not (tmp in S):\n S.append(tmp)\n c.append(1)\n else:\n c[S.index(tmp)]+=1\nS.sort()\nm=max(c)\nfor i in range(len(S)):\n if c[i]==m:\n print(S[i])', 'import collections\nN=int(input())\nS=[input() for i in range(N)]\nc=collections.Counter(S)\nfor i in range(len(c.most_common())):\n print(c.most_common()[i][0])\n if c.most_common()[i][1] !=c.most_common()[i+1][1]:\n break', 'import collections\nN = int(input())\ns = [input() for i in range(N)]\n \ncounter = collections.Counter(s)\ncount = counter.most_common()\n \nmost = count[0][1]\n \nc =[]\nfor i in range(len(counter)):\n if count[i][1] == most:\n c.append(count[i][0])\n \nc.sort()\n \nfor i in range(len(c)):\n print(c[i])'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s191010772', 's232954895', 's354630716', 's508482907', 's523017299', 's650436412', 's896096272', 's047100707'] | [4468.0, 45036.0, 45228.0, 47280.0, 35572.0, 4536.0, 45228.0, 47640.0] | [2104.0, 2106.0, 2105.0, 2106.0, 309.0, 2104.0, 2109.0, 719.0] | [206, 294, 157, 277, 276, 215, 221, 302] |
p02773 | u711238850 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = Counter(s)\nma = max(c.values())\nfor k,v in c.items():\n if ma == v:\n print(k)\n', 'from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = Counter(s)\nma = max(c.values())\nfor k,v in c:\n if ma == v:\n print(k)', 'from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = Counter(s)\nma = max(c.values())\nans = []\nfor k,v in c.items():\n if ma == v:\n ans.append(k)\n\nans = sorted(ans)\n\nfor a in ans:\n print(a)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s113088618', 's144545643', 's623336809'] | [35568.0, 35572.0, 35572.0] | [443.0, 317.0, 616.0] | [167, 158, 225] |
p02773 | u713914478 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nvalues, counts = zip(*c.most_common())\n\nfor i in range(counts.count(max(counts))):\n\tprint(values[i])', 'import collections\nN = int(input())\ns = [input() for i in range(N)]\n\nc = collections.Counter(s)\nvalues, counts = zip(*c.most_common())\n\nss = []\nfor i in range(counts.count(max(counts))):\n\tss.append(values[i])\n\nss.sort()\n\nfor sss in ss:\n\tprint(sss)'] | ['Wrong Answer', 'Accepted'] | ['s426492605', 's389304809'] | [59504.0, 59504.0] | [661.0, 773.0] | [197, 247] |
p02773 | u718949306 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nA = []\nfor n in range(N):\n A.append(input())\nA.sort()\nB = []\nfor n in range(N):\n C = 0\n for i in range(N):\n if A[n] == A[i]:\n C += 1\n B.append(C)\nm = max(B)\nD = []\nfor i in range(N):\n if m <= B[i]:\n D.append(A[i])\nD = list(set(D))\nfor i in range(len(D)):\n print(D[i])', 'N = int(input())\nA = {}\nB = []\nfor n in range(N):\n a = input()\n B.append(a)\n A[a] = 0\nfor n in range(N):\n A[B[n]] += 1\nres = 0\nC = []\nfor key, value in A.items():\n if res < value:\n res = value\nfor key, value, in A.items():\n if res <= value:\n C.append(key)\nC.sort()\nfor c in C:\n print(c)'] | ['Time Limit Exceeded', 'Accepted'] | ['s109308440', 's928906109'] | [17792.0, 33416.0] | [2104.0, 703.0] | [327, 321] |
p02773 | u721425712 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nl = []\nfor _ in range(n):\n ll = input()\n l.append(ll)\n \nss = set(l)\ns = list(ss)\n\nans = []\nfor i in range(len(s)):\n cnt = l.count(s[i])\n ans.append(cnt)\n \nm = max(ans)\nres = []\nfor j in range(len(ans)):\n if ans[j] == m:\n res.append(l[j])\n \nres.sort()\nfor k in range(len(res)):\n print(res[k])', 'n = int(input())\nl = []\nfor _ in range(n):\n ll = input()\n l.append(ll)\n \nss = set(l)\ns = list(ss)\n\nans = []\nfor i in range(len(s)):\n cnt = l.count(s[i])\n ans.append(cnt)\n \nm = max(ans)\nres = []\nfor j in range(len(ans)):\n if ans[j] == m:\n res.append(l[j])\n \nres.sort()\nfor k in range(len(res)):\n print(res[k])', 'n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n if s not in d:\n d[s] = 1\n else:\n d[s] += 1\nm = max(d.values())\nans = []\nfor i in d:\n if d[i] == m:\n ans.append(i)\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s294742091', 's726006551', 's887898722'] | [29076.0, 29076.0, 32220.0] | [2105.0, 2105.0, 650.0] | [346, 346, 241] |
p02773 | u723345499 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['[print(n) for n in max_name] [print(n) for n in max_name] n = int(input())\nname = {}\nfor _ in range(n):\n st = str(input())\n if st in name:\n tmp = name[st] + 1\n name[st] = tmp\n else:\n name[st] = 1\n\nmax_val = max(name.values())\nmax_name = [k for k, v in name.items() if v==max_val]\nmax_name.sort\nfor n in max_name:\n print(n)', 'n = int(input())\nname = {}\nfor i in range(n):\n st = str(input())\n if st in name:\n tmp = name[st] + 1\n name[st] = tmp\n else:\n name[st] = 1\n\nmax_val = max(name.values())\nmax_name = [k for k, v in name.items() if v==max_val]\nmax_name.sort\n\nfor n in max_name:\n print(n)', 'n = int(input())\nname = {}\nfor _ in range(n):\n st = str(input())\n if st in name:\n tmp = name[st] + 1\n name[st] = tmp\n else:\n name[st] = 1\n\nmax_val = max(name.values())\nmax_name = [k for k, v in name.items() if v==max_val]\nmax_name.sort\n\n[print(n) for n in max_name] ', 'n = int(input())\nname = {}\nfor i in range(n):\n st = str(input())\n if st in name:\n tmp = name[st] + 1\n name[st] = tmp\n else:\n name[st] = 1\n\nmax_val = max(name.values())\nmax_name = [k for k, v in name.items() if v==max_val]\nmax_name.sort\n\nfor n in max_name:\n print(n)', 'n = int(input())\nname = {}\nfor i in range(n):\n st = str(input())\n if st in name:\n tmp = name[st] + 1\n name[st] = tmp\n else:\n name[st] = 1\n\nmax_val = max(name.values())\nmax_name = [k for k, v in name.items() if v==max_val]\nmax_name = sorted(max_name)\n\nfor n in max_name:\n print(n)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s506893744', 's667606900', 's843993888', 's907632086', 's817238760'] | [2940.0, 32096.0, 32600.0, 32096.0, 32988.0] | [17.0, 554.0, 509.0, 521.0, 706.0] | [355, 298, 296, 298, 312] |
p02773 | u723792785 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["from collections import Counter\n \n\nn = int(input())\ns = [input() for _ in range(n)]\nc = collections.Counter(s).most_common() \n\n\n#[('vet', 2), ('beet', 2), ('beat', 1), ('bed', 1), ('bet', 1)]\n \nans = []\nmax = c[0][1] \nfor item,count in c:\n\tif count==max:\n\t\tans.append(item)\n\telse:\n\t\tbreak \n \nans.sort() \n \nfor i in range(len(ans)):\n\tprint(ans[i])", "from collections import Counter\n\n\nn = int(input())\ns = [input() for _ in range(n)]\nc = Counter(s).most_common() \n\n\n# [('vet', 2), ('beet', 2), ('beat', 1), ('bed', 1), ('bet', 1)]\n\nans = []\nmax = c[0][1] \nfor item, count in c:\n\tif count == max:\n\t\tans.append(item)\n\telse:\n\t\tbreak \n\nans.sort() \n\nfor i in range(len(ans)):\n\tprint(ans[i])"] | ['Runtime Error', 'Accepted'] | ['s627952486', 's038790771'] | [17408.0, 45040.0] | [262.0, 841.0] | [609, 608] |
p02773 | u726984689 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nS = []\nfor i in range(n):\n S.append(input())\nT = list(set(S))\nfor i in range(len(T)):\n count.append(S.count(T[i]))\nbest = max(count)\nans = []\nfor i in range(len(T)):\n if count[i] == best:\n ans.append( T[i])\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i]) ', 'from collections import Counter\nn = int(input())\nS = []\nfor i in range(n):\n S.append(input())\nS = sorted(S)\nc = Counter(S)\nX = c.most_common()\nA = []\nfor i in range(len(X)):\n if X[0][1] == X[i][1]:\n A.append(X[i][0])\n else:\n break\nA = sorted(A)\nfor i in range(len(A)):\n print(A[i])'] | ['Runtime Error', 'Accepted'] | ['s838618992', 's612721633'] | [29076.0, 49428.0] | [326.0, 972.0] | [290, 291] |
p02773 | u727148417 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\n\nS = {}\n\nA = [""]*N\nfor i in range(0, N):\n A[i] = A[i] + input()\n\nfor i in range(0, N):\n if not (A[i] in S.keys()):\n S[A[i]] = 1\n else:\n S[A[i]] = S[A[i]] + 1\n\nmax = 0\nfor value in S.values():\n if value > max:\n max = value\n\nS0 = {}\nfor key, value in S.items():\n if value == max:\n S0[key] = 0\n\nfor key in S0.keys():\n print(key)', "from collections import Counter\nN = int(input())\nS = [input() for i in range(N)]\nC = Counter(S)\ndekai = max(C.values())\nM = [kv[0] for kv in C.items() if kv[1] == dekai]\nM.sort()\nA = '\\n'.join(M)\nprint(A)"] | ['Wrong Answer', 'Accepted'] | ['s484311814', 's144207538'] | [53600.0, 35952.0] | [592.0, 529.0] | [389, 204] |
p02773 | u728318205 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["n =int(input())\ns_list = list(input() for i in range(1,n+1))\n\nfrom collections import Counter\n\nc = Counter(s_list)\nmax = max(list(c.values()))\n\nlist = []\nfor kv in c.items():\n if kv[1]== max:\n list.append(kv[0])\n\nlist_new = '\\n'.join(list)\n\nprint(list_new)\n \n\n \n\n\n", "n =int(input())\ns_list = list(input() for i in range(1,n+1))\n\nfrom collections import Counter\n\nc = Counter(s_list)\nmax = max(list(c.values()))\n\nlist = []\nfor kv in c.items():\n if kv[1]== max:\n list.append(kv[0])\n\n\nlist.sort()\nlist_new = '\\n'.join(list)\n\nprint(list_new)\n \n\n \n\n\n"] | ['Wrong Answer', 'Accepted'] | ['s239041335', 's244474860'] | [35992.0, 35984.0] | [413.0, 557.0] | [288, 301] |
p02773 | u729535891 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from itertools import Counter\nn = int(input())\nlst = [0]*n\nfor i in range(n):\n s = input()\n lst[i] = s\n\nc = Counter(lst)\nmax_num = max(c.values())\nmost_lst = sorted([k for k, v in c.items() if v == max_num])\nfor x in most_lst:\n print(x)', 'from collections import Counter\nn = int(input())\nlst = [0]*n\nfor i in range(n):\n s = input()\n lst[i] = s\n\nc = Counter(lst)\nmax_num = max(c.values())\nmost_lst = sorted([k for k, v in c.items() if v == max_num])\nfor x in most_lst:\n print(x)'] | ['Runtime Error', 'Accepted'] | ['s614895189', 's787854672'] | [3060.0, 35560.0] | [18.0, 643.0] | [245, 247] |
p02773 | u731436822 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import numpy as np\nN = int(input())\nS = [input() for __ in range(N)]\n\nS = np.array(S)\nkeys = set(S)\nans = {}\ncnt = 0\nls = []\nfor key in keys:\n ans[key] = len(np.where(S == key)[0])\n\nmax_v = max(ans.values())\nkeys = [k for k, v in d.items() if v == max_v]\nkeys.sort()\nfor key in keys:\n print(key)', 'N = int(input())\nd = {}\nfor i in range(N):\n S = input()\n if S in d.keys():\n d[S] = d[S] + 1\n else:\n d[S] = 1\nmax_val = max(d.values())\nmax_k_ls = [kv[0] for kv in d.items() if kv[1]==max_val]\nmax_k_ls = sorted(max_k_ls)\n\nprint(*max_k_ls, sep="\\n")'] | ['Runtime Error', 'Accepted'] | ['s846537302', 's623558802'] | [51564.0, 34012.0] | [2110.0, 610.0] | [301, 270] |
p02773 | u735069283 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nN=int(input())\nS=[]\nfor i in range(N):\n s=str(input())\n S +=[s]\nT=collections.Counter(S)\nP=list(T.keys())\nQ=list(T.values())\nfor i in range(len(P)):\n if Q[i]==max(Q):\n print(P[i])', 'import collections\nN=int(input())\nS=[]\nfor i in range(N):\n s=str(input())\n S +=[s]\nT=collections.Counter(S)\nanswer=T.most_common()\nfor i in range(len(T)):\n if answer[i][1]==answer[0][1]:\n print(answer[i][0])\n else:\n break', 'import collections\nN=int(input())\nS=[]\nfor i in range(N):\n s=str(input())\n S +=[s]\nT=collections.Counter(S)\nanswer=T.most_common()\nA=[]\nfor i in range(len(T)):\n if answer[i][1]==answer[0][1]:\n A +=[answer[i][0]]\n else:\n break\nA=sorted(A)\nfor a in A:\n print(a)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s504006740', 's980354082', 's564401887'] | [35564.0, 46844.0, 49396.0] | [2105.0, 731.0, 970.0] | [204, 231, 270] |
p02773 | u735335967 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nn = int(input())\ns = collections.Counter([input() for i in range(n)])\n\nvalues, counts = zip(*s.most_common())\n\nlen = counts.count(max(counts))\n\nfor i in range(len):\n print(values[i])\n', 'n = int(input())\ns = sorted([input() for i in range(n)])\nc = [1]*n\n\nfor i in range(n-1):\n if s[i] == s[i+1]:\n c[i+1] += c[i]\nm = max(c)\n\nfor i in range(n):\n if c[i] == m:\n print(s[i])\n'] | ['Wrong Answer', 'Accepted'] | ['s965998311', 's188459087'] | [57940.0, 24744.0] | [657.0, 645.0] | [205, 204] |
p02773 | u736342571 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nd = {}\nfor i in range(0,n):\n c = input()\n if c in d:\n d[c] +=1\n else:\n d[c] = 1\nmax_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]\nfor i in range(0,len(max_k_list)):\n print(max_k_list[i])', 'q=int(input())\ndic={}\nfor i in range(q):\n s=input()\n if not s in dic:\n dic[s]=1\n else:\n dic[s]+=1\nmax_val=max(dic.values())\na=sorted([i for i, k in dic.items() if k == max_val])\nfor i in a:\n print(i)\n '] | ['Wrong Answer', 'Accepted'] | ['s907176513', 's081585294'] | [35228.0, 35600.0] | [2207.0, 431.0] | [232, 228] |
p02773 | u736470924 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nD = {}\nfor i in range(N):\n S = input()\n if S in D:\n D[S] += 1\n else:\n D[S] = 1\n\nD_sorted = sorted(D.items(), key=lambda x:x[0])\nD_sorted = sorted(D_sorted, key=lambda x:x[1], reverse=True)\nfor k in D_sorted:\n print(k[0])\n', 'N = int(input())\nD = {}\nfor i in range(N):\n S = input()\n if S in D:\n D[S] += 1\n else:\n D[S] = 1\n\nD_sorted = sorted(D.items(), key=lambda x:x[0])\nD_sorted = sorted(D_sorted, key=lambda x:x[1], reverse=True)\n\ntop = D_sorted[0][1]\nfor k in D_sorted:\n if top == k[1]:\n print(k[0])\n else:\n exit()\n'] | ['Wrong Answer', 'Accepted'] | ['s494313243', 's356051379'] | [46684.0, 46684.0] | [772.0, 875.0] | [248, 309] |
p02773 | u743354620 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\nc = collections.Counter(S)\nc.sort()\nvalues, counts = zip(*c.most_common())\nif len(values) == 1:\n print(values[0])\nelse:\n for i in range(N):\n if counts[i] == counts[0]:\n print(values[i])\n else:\n exit()', 'import collections\nimport sys\n\nN = int(input())\nS = [input() for _ in range(N)]\nS.sort()\nc = collections.Counter(S)\nvalues, counts = zip(c.most_common())\nif len(values) == 1:\n print(values[0])\nelse:\n for i in range(N):\n if counts[i] == counts[0]:\n print(values[i])\n else:\n sys.exit()', 'import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\nc = collections.Counter(S)\nc.most_common().sort()\nvalues, counts = zip(*c.most_common())\nif len(values) == 1:\n print(values[0])\nelse:\n for i in range(N):\n if counts[i] == counts[0]:\n print(values[i])\n else:\n exit()', 'import collections\n\nN = int(input())\nS = [input() for _ in range(N)]\n\nc = collections.Counter(S)\nvalue_and_counts = c.most_common()\n\nmax_number = value_and_counts[0][1]\n\nvalue_and_counts.sort()\n\nfor i in value_and_counts:\n if max_number == i[1]:\n print(i[0])'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s210110318', 's525582565', 's708687267', 's695175747'] | [35564.0, 45088.0, 59524.0, 46900.0] | [301.0, 537.0, 985.0, 942.0] | [311, 325, 325, 268] |
p02773 | u743374900 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nS = {}\nfor i in range(N):\n s = input()\n if s in S:\n S[s] += 1\n else:\n S[s] = 1\nsorted_S = sorted(S.items(), key=lambda x: x[1], reverse=True)\na = []\ncount = -1\nfor s in sorted_S:\n if count == -1:\n a.append(s)\n count = sorted_S[s]\n elif count == sorted_S[s]:\n a.append(s)\n else:\n break\nsorted_a = sorted(a)\nfor s in sorted_a:\n print(s)', 'N = int(input())\nS = {}\nfor i in range(N):\n s = input()\n if s in S:\n S[s] += 1\n else:\n S[s] = 1\nsorted_S = sorted(S.items(), key=lambda x: x[1], reverse=True)\na = []\ncount = -1\nfor s in sorted_S:\n if count == -1:\n a.append(s[0])\n count = s[1]\n elif count == s[1]:\n a.append(s[0])\n else:\n break\nsorted_a = sorted(a)\nfor s in sorted_a:\n print(s)'] | ['Runtime Error', 'Accepted'] | ['s675689257', 's095780158'] | [43228.0, 47324.0] | [416.0, 800.0] | [414, 406] |
p02773 | u744034042 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ns = [input() for i in range(n)]\ns.sort()\nfrom collections import Counter\ns1 = collections.Counter(s)\ns2 = list(set(s))\ns2.sort()\nfor i in range(len(s2)):\n if s1[s2[i]] == max(s1.values()):\n print(s2[i])', 'n = int(input())\ns = [input() for i in range(n)]\nfrom collections import Counter\ns1 = Counter(s)\nmax_s = max(s1.values())\nans = []\nfor k,v in s1.items(): \n if v == max_s:\n ans.append(k)\nans.sort()\nfor a in ans:\n print(a)'] | ['Runtime Error', 'Accepted'] | ['s352292493', 's647612945'] | [17800.0, 35476.0] | [405.0, 635.0] | [229, 233] |
p02773 | u744683641 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\n\nn =int(input())\nslist = []\nfor _ in range(n):\n s = input()\n slist.appemd(s)\n\nCounter(slist)', 'from collections import defaultdict\n\nn =int(input())\n\nd = defaultdict(int)\n\nfor _ in range(n):\n s = input()\n d[s] += 1\n\nresult = sorted(d.items(), key=lambda x: -x[1])\n\nmax_val = 0\nmaxes = []\nfor r in result:\n if max_val > r[1]:\n break\n else:\n max_val = r[1]\n maxes.append(r[0])\n\nprint(sorted(maxes))\n', 'from collections import defaultdict\n\nn =int(input())\n\nd = defaultdict(int)\n\nfor _ in range(n):\n s = input()\n d[s] += 1\n\nresult = sorted(d.items(), key=lambda x: -x[1])\n\nmax_val = 0\nmaxes = []\nfor r in result:\n if max_val > r[1]:\n break\n else:\n max_val = r[1]\n maxes.append(r[0])\n\nprint("\\n".join(sorted(maxes)))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s262685101', 's874697102', 's776346117'] | [3316.0, 52056.0, 48732.0] | [21.0, 811.0, 769.0] | [126, 334, 345] |
p02773 | u744920373 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\n\nA = [input() for i in range(N)]\n\ndic = {}\n\nfor i in A:\n if i not in dic:\n dic[i] = 1\n else:\n dic[i] += 1\n\nde = 0\n\nans_list = []\n\n\nfor k, v in sorted(dic.items(), key=lambda x: x[1], reverse = True):\n if v != de and de !=0:\n exit()\n else:\n ans_list.append(k)\n de = v\n\nans_list_n = sorted(ans_list)\n\nfor i in ans_list_n:\n print(i)', 'N = int(input())\n\nA = [input() for i in range(N)]\n\ndic = {}\n\nfor i in A:\n if i not in dic:\n dic[i] = 1\n else:\n dic[i] += 1\n\nde = 0\n\n\n\nfor k, v in sorted(dic.items(), key=lambda x: x[1], reverse = True):\n if v != de and de !=0:\n exit()\n else:\n print(k)\n de = v', "import sys\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]\ndef dp2(ini, i, j): return [[ini]*i for i2 in range(j)]\ndef dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]\n\nfrom collections import defaultdict \n'''\nN = ii()\nA = li()\n \nright = 1\ncnt = 0\n'''\n'''\nmae = A[0]\nfor left in range(N):\n if left==right:\n right += 1\n mae = A[right-1]\n while right < N and A[right] > mae:\n mae = A[right]\n right += 1\n \n #print(left, right, mae)\n cnt += right-left\n'''\n'''\nfor left in range(N):\n while right < N and A[right] > A[right-1]:\n right += 1\n \n cnt += right-left\n if left+1 == right:\n right += 1\n \nprint(cnt)\n'''\n\nN = ii()\nS = [input() for i in range(N)]\nd = defaultdict(int)\n\nfor word in S:\n d[word] += 1\n\n\nd2 = sorted(d.items(), key=lambda x:x[1], reverse=True)\n\nnum = d2[0][1]\nans = []\nfor i in range(len(d2)):\n if num != d2[i][1]:\n break\n ans.append(d2[i][0])\n\nfor word in sorted(ans):\n print(word)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s696467584', 's931349403', 's837949693'] | [44688.0, 46480.0, 49240.0] | [800.0, 578.0, 885.0] | [492, 398, 1276] |
p02773 | u745687363 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\nm = max(S.count(S[i]), for i in range(N))\nS_new = set(S)\nfor s in S_new:\n if m == S.count(s):\n print(s)\n ', 'import collections\nN = int(input())\nS = []\nfor i in range(N):\n S.append(str(input()))\nA = collections.Counter(S)\nm = max(A.values())\nfor s in sorted(set(S)):\n if A[s] == m:\n print(s)\n '] | ['Runtime Error', 'Accepted'] | ['s993345789', 's680942925'] | [2940.0, 44272.0] | [18.0, 765.0] | [173, 190] |
p02773 | u748241164 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\ns = [0] * N\ntime = [1] * N\nj = 0\nfor i in range(N):\n inp = str(input())\n if inp in s:\n x = s.index(inp)\n time[x] += 1\n else:\n s[j] = inp\n j += 1\n \nans = max(time)\n#print(s, time)\nfor i in range(N):\n if time[i] == ans:\n if s[i] != 0:\n print(s[i])', 'import collections\nN = int(input())\ns = [0] * N\nfor i in range(N):\n s[i] = str(input())\n \nt = collections.Counter(s)\nu = list(t.items())\nx = u[0][1]\nans = []\nfor i in range(len(u)):\n if u[i][1] == x:\n ans.append(u[i][0])\n else:\n quit()\nans = sorted(ans)\n\nfor i in range(len(ans)):\n print(ans[i])\n ', 'import collections\nN = int(input())\ns = [0] * N\nfor i in range(N):\n s[i] = str(input())\n \n#print(s)\nt = collections.Counter(s)\n#print(t)\nu = list(t.items())\n#print(u)\nx = u[0][1]\nans = []\nfor i in range(len(u)):\n if u[i][1] == x:\n ans.append(u[i][0])\n \nans = sorted(ans)\n\nfor i in range(len(ans)):\n print(ans[i])\n ', 'import collections\nN = int(input())\ns = [0] * N\nfor i in range(N):\n s[i] = str(input())\n \n#print(s)\nt = collections.Counter(s)\nu = list(t.items())\n#print(u)\nx = max(list(t.values()))\nans = []\n#print(x)\n#print(u)\nfor i in range(len(u)):\n #print(u[i][1], x)\n if u[i][1] == x:\n ans.append(u[i][0])\n \n \nans = sorted(ans)\n\nfor i in range(len(ans)):\n print(ans[i])\n '] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s810097462', 's832593262', 's896055436', 's965074314'] | [6132.0, 49192.0, 49192.0, 49192.0] | [2108.0, 869.0, 764.0, 912.0] | [289, 311, 327, 377] |
p02773 | u748311048 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N=int(input())\nKnL=[]\nVnL=[]\n\nfor _ in range(N):\n inp=str(input())\n if not inp in KnL:\n KnL.append(inp)\n VnL.append([0,inp])\n VnL[KnL.index(inp)][0]+=1\n\nVnL.sort()\nVnL.reverse()\n\nfor i in range(len(VnL)):\n if VnL[0][0]>VnL[i][0]:\n exit()\n print(VnL[i][1])', 'import collections\nN=int(input())\nL=[]\nNL=[]\ncL={}\nfor _ in range(N):\n L.append(str(input()))\n\ncL=collections.Counter(L)\nv,c=zip(*cL.most_common())\n\nfor i in range(len(v)):\n if c[0]==c[i]:\n \tNL.append(v[i])\nNL.sort()\nfor j in range(len(NL)):\n print(NL[j])'] | ['Wrong Answer', 'Accepted'] | ['s293031307', 's641511032'] | [5108.0, 59500.0] | [2104.0, 903.0] | [269, 286] |
p02773 | u749742659 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\n\ndic = {}\nma = 1\n\nfor i in range(n):\n wo = input()\n if(wo in dic):\n dic[wo] += 1\n if(dic[wo] > ma):\n ma = dic[wo]\n else:\n dic.update({wo:1})\n\n\nfor i in dic.keys():\n if(dic[i] == ma):\n print(i)\n', 'n = int(input())\n\ndic = {}\nma = 1\n\nfor i in range(n):\n wo = input()\n if(wo in dic):\n dic[wo] += 1\n if(dic[wo] > ma):\n ma = dic[wo]\n else:\n dic.update({wo:1})\n\nprint(dic)\n\nfor i in dic.keys():\n if(dic[i] == ma):\n print(i)\n', 'n = int(input())\n\ndic = {}\nma = 1\n\nfor i in range(n):\n wo = input()\n if(wo in dic):\n dic[wo] += 1\n if(dic[wo] > ma):\n ma = dic[wo]\n else:\n dic.update({wo:1})\n\n\nans = []\nfor i in dic.keys():\n if(dic[i] == ma):\n ans.append(i)\nans.sort()\nfor j in ans:\n print(j)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s560244103', 's661208600', 's094550735'] | [35224.0, 37484.0, 35416.0] | [401.0, 428.0, 472.0] | [261, 272, 313] |
p02773 | u750838232 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = collections.Counter(s)\n\nb, most = c.most_common(1)[0]\n\nfor i,j in c.most_common():\n if j != most:\n break\n print(i)', 'import collections\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = collections.Counter(s)\n\nb, most = c.most_common(1)[0]\n\nans = []\nfor i,j in c.most_common():\n if j != most:\n break\n ans.append(i)\nfor ans_v in sorted(ans):\n print(ans_v)'] | ['Wrong Answer', 'Accepted'] | ['s989796549', 's898436253'] | [46872.0, 45804.0] | [561.0, 712.0] | [193, 248] |
p02773 | u751539777 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nN = int(input())\na = []\n\nfor i in range(N):\n a.append(str(input()))\na = collections.Counter(a)\nb = max(a.values())\n\nmax_k_list = [kv[0] for kv in a.items() if kv[1] == b]\nmax_k_list = sorted(max_k_list)\n\nfor i in max_k_list:\nprint(i) ', 'import collections\n\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\n\nc = collections.Counter(s)\nc_s = c.most_common()\nm = c.most_common()[0][1]\nans = []\nfor j in range(len(c_s)):\n if c_s[j][1] != m:\n break\n else:\n ans.append(c_s[j][0])\nans.sort()\nfor t in ans:\n print(t)'] | ['Runtime Error', 'Accepted'] | ['s575915289', 's229967644'] | [3064.0, 59376.0] | [17.0, 833.0] | [259, 310] |
p02773 | u752907966 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['def main():\n from collections import Counter\n import sys\n input = sys.stdin.readline\n n=int(input())\n s=[]\n for _ in []*n:\n s.append(input().rstrip())\n c = Counter(s)\n ans=[]\n max_vote = max(c.values())\n for i,j in c.items():\n if j == max_vote:\n ans.append(i)\n print("\\n".join(sorted(ans)))\nmain()', 'def main():\n from collections import Counter\n import sys\n input = sys.stdin.readline\n n=int(input())\n s=[]\n ap = s.append\n for _ in [0]*n:\n ap(input().rstrip())\n c = Counter(s)\n ans=[]\n max_vote = max(c.values())\n for i,j in c.items():\n if j == max_vote:\n ans.append(i)\n print("\\n".join(sorted(ans)))\nmain()'] | ['Runtime Error', 'Accepted'] | ['s532847267', 's522153849'] | [3316.0, 35932.0] | [21.0, 326.0] | [355, 368] |
p02773 | u756030237 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\n\na = int(input())\na_list = []\nans_list = []\n\nfor i in range(a):\n a_list.append(input())\n\na_counter = Counter(a_list)\n\n_v = 0\nfor k, v in a_counter.most_common():\n if _v == 0 or _v == v:\n _v = v\n ans_list.append(k)\n elif _v > v:\n break\n\nans = sorted(ans_list)\nprint(ans)', 'from collections import Counter\n\na = int(input())\na_list = []\nans_list = []\n\nfor i in range(a):\n a_list.append(input())\n\na_counter = Counter(a_list)\n\n_v = 0\nfor k, v in a_counter.most_common():\n if _v == 0 or _v == v:\n _v = v\n ans_list.append(k)\n elif _v > v:\n break\n\nans = sorted(ans_list)\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s341691984', 's486056415'] | [45040.0, 45164.0] | [701.0, 746.0] | [323, 337] |
p02773 | u757030836 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\n\nS = []\nfor i in range(N):\n S.append(input())\n\nds ={} \nfor a in S:\n if a in ds:\n ds[a] +=1\n else:\n ds[a] =1\n \nm = max(ds.values())\n\nkeys = [k for k,v in ds.items() if v == m]\nprint(keys)', 'N = int(input())\n\nS = []\nfor i in range(N):\n S.append(input())\n\nds ={} \nfor a in S:\n if a in ds:\n ds[a] +=1\n else:\n ds[a] =1\n \nmax = max(ds.values())\n\nkeys = [k for k,v in ds.items() if v == max]\n\nprint(keys)\n\n', 'N = int(input())\n\nS = []\nfor i in range(N):\n S.append(input())\n\nds ={} \n\nfor a in S:\n if a in ds:\n ds[a] +=1\n else:\n ds[a] =1\n \nm = max(ds.values())\n\nkeys = [k for k,v in ds.items() if v == m]\n\nprint(keys)', 'N=int(input())\n\nS=[]\nfor i in range(N):\n S.append(input())\n\nds={} \nfor a in S:\n if a in ds:\n ds[a] +=1\n else:\n ds[a] =1\n \nm = max(ds.values())\n\nkeys = [k for k,v in ds.items() if v == m]\nprint(keys)', 'n = int(input())\ns = [input() for i in range(n)]\nd = {}\n\nfor i in range(n):\n if s[i] in d:\n d[s[i]] += 1\n elif not(s[i] in d):\n d[s[i]] =1\n \nsort_d = sorted(d.values(),reverse=True)\nmax = sort_d[0]\n\nans =[]\n\nfor j in d:\n if d[j] == max:\n ans.append(j)\n\nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s046415571', 's567083058', 's748911128', 's975308380', 's404227806'] | [37392.0, 37392.0, 37384.0, 37392.0, 35220.0] | [428.0, 432.0, 399.0, 440.0, 687.0] | [216, 223, 218, 211, 323] |
p02773 | u759518460 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\nwords = [input() for _ in range(n)]\nc = collections.Counter(words)\nmax_c = c.most_common()\nans = [max_c[0][0]]\n\nfor i in range(1, len(max_c)):\n if max_c[i][1] == max_c[i-1][1]:\n ans.append(max_c[i][0])\n else:\n break\n\nans_sorted = sorted(ans, reverse=True)\nfor i in range(len(ans)):\n print(ans_sorted[i])', 'import collections\n\nn = int(input())\nwords = [input() for _ in range(n)]\nc = collections.Counter(words)\nmax_c = c.most_common()\nans = [max_c[0][0]]\n\nfor i in range(1, len(max_c)):\n if max_c[i][1] == max_c[i-1][1]:\n ans.append(max_c[i][0])\n else:\n break\n\nans_sorted = sorted(ans)\nfor i in range(len(ans)):\n print(ans_sorted[i])'] | ['Wrong Answer', 'Accepted'] | ['s286827676', 's460480714'] | [49268.0, 49172.0] | [753.0, 778.0] | [363, 349] |
p02773 | u762275701 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\n\ndic = {}\nfor i in range(n):\n s = input()\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n\n_max = 0\nfor v in dic.values():\n if _max < v:\n _max = v\n\nfor k,v in dic.items():\n if v == _max:\n print(k)', 'n = int(input())\n\ndic = {}\nfor i in range(n):\n s = input()\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n\n_max = 0\nfor v in dic.values():\n if _max < v:\n _max = v\ndic2 = sorted(dic.items())\n\nfor (k,v) in dic2:\n if v == _max:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s616646491', 's736604433'] | [32096.0, 44124.0] | [463.0, 776.0] | [228, 250] |
p02773 | u762420987 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nN = int(input())\nSc = Counter([input() for _ in range(N)]).most_common()\nprint(Sc)\nmax_num = Sc[0][1]\nans = []\nfor key, val in Sc:\n if val == max_num:\n ans.append(key)\nans.sort()\nfor t in ans:\n print(t)', 'N = int(input())\nfrom collections import Counter\nSc = Counter([input() for _ in range(N)])\nmax_count = max(Sc.values())\nans = sorted([k for k, v in Sc.items() if v == max_count)])\nprint(*ans, sep="\\n")', 'N = int(input())\nfrom collections import Counter\nSc = Counter([input() for _ in range(N)])\nmax_count = max(Sc.values())\nans = sorted([k for k, v in Sc.items() if v == max_count])\nprint(*ans, sep="\\n")'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s211534422', 's495141569', 's419061823'] | [43476.0, 3188.0, 35584.0] | [786.0, 18.0, 601.0] | [247, 201, 200] |
p02773 | u765590009 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\n\nwords = {}\nfor i in range(n):\n word = input()\n if word in words:\n words[word] += 1\n else :\n words[word] = 1\n\nwords_sorted = sorted(words.items(), key=lambda x:x[1], reverse=True) \nscore = words_sorted[0][1]\nfor word in words_sorted:\n if score == word[1]:\n print(word[0])\n else :\n break', 'n = int(input())\n\nwords = {}\nfor i in range(n):\n word = input()\n if word in words:\n words[word] += 1\n else :\n words[word] = 1\nwords_sorted = sorted(words.items(), key=lambda x:x[1], reverse=True) \nscore = words_sorted[0][1]\nanswers = []\nfor word in words_sorted:\n if score == word[1]:\n answers.append(word[0])\n else :\n break\n \nfor answer in sorted(answers) :\n print(answer)'] | ['Wrong Answer', 'Accepted'] | ['s844057072', 's484493930'] | [47596.0, 50056.0] | [387.0, 500.0] | [323, 397] |
p02773 | u766393261 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import sys\nfrom collections import Counter\nN=int(input())\nS=['']*N\nfor i in range(N):\n S[i]=input()\ncounter = Counter(S)\nans=[0]*len(counter)\nnum=0\nfor word, cnt in counter.most_common():\n ans[num]=cnt\n num+=1\nanker=ans[0]\nankernum=0\nfor j in range(len(counter)):\n if ans[j]!=anker:\n ankernum=j\n break\n elif j==len(counter)-1:\n ankernum=j+1\nprint(ankernum)\nword_ans=['']*len(counter)\nk=0\nfor word, cnt in counter.most_common():\n word_ans[k]=word\n k+=1\n\nfor l in sorted(word_ans[:ankernum]):\n print(l)", "import sys\nfrom collections import Counter\nN=int(input())\nS=['']*N\nfor i in range(N):\n S[i]=input()\ncounter = Counter(S)\nans=[0]*len(counter)\nnum=0\nfor word, cnt in counter.most_common():\n ans[num]=cnt\n num+=1\nanker=ans[0]\nankernum=0\nfor j in range(len(counter)):\n if ans[j]!=anker:\n ankernum=j\n break\n elif j==len(counter)-1:\n ankernum=j+1\nprint(ankernum)\nword_ans=['']*len(counter)\nk=0\nfor word, cnt in counter.most_common():\n word_ans[k]=word\n k+=1\n\nfor l in sorted(word_ans[:ankernum]):\n print(l)", "import sys\nfrom collections import Counter\nN=int(input())\nS=['']*N\nfor i in range(N):\n S[i]=input()\ncounter = Counter(S)\nans=[0]*len(counter)\nnum=0\nfor word, cnt in counter.most_common():\n ans[num]=cnt\n num+=1\nanker=ans[0]\nankernum=0\nfor j in range(len(counter)):\n if ans[j]!=anker:\n ankernum=j\n break\nword_ans=['']*len(counter)\nk=0\nfor word, cnt in counter.most_common():\n word_ans[k]=word\n k+=1\n\nprint(sorted(word_ans[:ankernum]))", "import sys\nfrom collections import Counter\nN=int(input())\nS=['']*N\nfor i in range(N):\n S[i]=input()\ncounter = Counter(S)\nans=[0]*len(counter)\nnum=0\nfor word, cnt in counter.most_common():\n ans[num]=cnt\n num+=1\nanker=ans[0]\nankernum=0\nfor j in range(len(counter)):\n if ans[j]!=anker:\n ankernum=j\n break\n elif j==len(counter)-1:\n ankernum=j+1\nword_ans=['']*len(counter)\nk=0\nfor word, cnt in counter.most_common():\n word_ans[k]=word\n k+=1\n\nfor l in sorted(word_ans[:ankernum]):\n print(l)"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s038190521', 's259698297', 's368901778', 's669526199'] | [48348.0, 48348.0, 48356.0, 48348.0] | [934.0, 932.0, 612.0, 874.0] | [545, 545, 464, 529] |
p02773 | u768256617 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\nlist_s=[]\nfor i in range(n):\n s=input()\n list_s.append(s)\nlist_cnt=[] \nlist_t=list(set(sorted(list_s))) \nfor i in list_t:\n cnt=list_s.count(i)\n list_cnt.append(cnt)\n \nfor i in range(len(list_cnt)):\n if list_cnt[i]==max(list_cnt):\n print(list_t[i])\n \n \n \n \n ', 'n=int(input())\nd={}\nfor i in range(n):\n s=input()\n if s not in d:\n d.setdefault(s,1)\n \n else:\n d[s]+=1\n \nlargest =max(d.values())\nlist_d=[]\nfor i in d.keys():\n if d[i]==largest:\n list_d.append(i)\n \nlist_d.sort()\n\nfor i in list_d:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s550780477', 's473170585'] | [37668.0, 32096.0] | [2206.0, 695.0] | [288, 262] |
p02773 | u769870836 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\nd={}\nfor i in range(n):\n s=input()\n if s in d:\n d[s]+=1\n else:\n d[s]=0\nm=max(d.values())\nfor x in d.keys():\n if d[x]==m:\n print(x)', 'n=int(input())\nd={}\nfor i in range(n):\n s=input()\n if s in d:\n d[s]+=1\n else:\n d[s]=0\nm=max(d.values())\nans=[]\nfor x in d.keys():\n if d[x]==m:\n ans.append(x)\nans.sort()\nfor x in ans:\n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s897002113', 's467648734'] | [32096.0, 32096.0] | [469.0, 642.0] | [158, 206] |
p02773 | u771007149 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(str(input()))\n\ns_c = Counter(s).most_common()\nm = s_c[0][1]\n\nprint(s_c)\nprint(m)\nans = []\n\nfor j in range(len(s_c)):\n if s_c[j][1] != m:\n break\n else:\n ans.append(s_c[j][0])\n \nans.sort()\n\nfor k in ans:\n print(k)', 'from collections import Counter\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(str(input()))\n\ns_c = Counter(s).most_common()\nm = s_c[0][1]\n\nans = []\n\nfor j in range(len(s_c)):\n if s_c[j][1] != m:\n break\n else:\n ans.append(s_c[j][0])\n \nans.sort()\n\nfor k in ans:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s817326297', 's998597816'] | [45040.0, 45032.0] | [872.0, 779.0] | [329, 309] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.