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 | u297802287 | 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())\na = []\nfor i in range(n):\n a.append(input())\nb = Counter(a)\nfor k, v in b.items():\n if v == max(b.values()):\n print(k)\n', 'b = {}\nfor _ in range(int(input())): s=input(); b[s]=b.get(s,0)+1\nprint(*sorted(k for k in b if b[k]==max(b.values())))', 'from collections import Counter\n\nn = int(input())\na = []\nfor i in range(n):\n a.append(input())\nb = Counter(a)\nm = max(b.values())\nfor k, v in sorted(b.items()):\n if v == m:\n print(k)\n'] | ['Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s206407458', 's850659768', 's982394429'] | [38908.0, 35308.0, 48596.0] | [2206.0, 2206.0, 572.0] | [182, 119, 196] |
p02773 | u299791633 | 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\ncount = input()\n\nl = []\nfor i in range(int(count)):\n l.append(input())\nc = collections.Counter(l)\n#print(l)\n#print(c)\n#print(c.most_common()[0][1])\nmax_count = c.most_common()[0][1]\nfor i in c.most_common():\n if i[1] != max_count:\n exit()\n print(i[0])\n\n', 'import collections\n\ncount = input()\n\nl = []\nans = []\nfor i in range(int(count)):\n l.append(input())\nc = collections.Counter(l)\n#print(l)\n#print(c)\n#print(c.most_common()[0][1])\nprint("--")\nmax_count = c.most_common()[0][1]\nfor i in c.most_common():\n if i[1] != max_count:\n exit()\n #print(i[0])\n ans.append(i[0])\nans.sort()\nfor i in ans:\n print(i)\n\n', 'import collections\n\ncount = input()\n\nl = []\nans = []\nfor i in range(int(count)):\n l.append(input())\nc = collections.Counter(l)\n#print(l)\n#print(c)\n#print(c.most_common()[0][1])\nmax_count = c.most_common()[0][1]\nfor i in c.most_common():\n if i[1] != max_count:\n break\n #print(i[0])\n ans.append(i[0])\nans.sort()\nfor i in ans:\n print(i)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s158039364', 's192566887', 's299125128'] | [46836.0, 45036.0, 45040.0] | [608.0, 823.0, 751.0] | [289, 370, 357] |
p02773 | u301257907 | 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\nhash = {}\nfor i in range(N):\n\tkey = input()\n\tif key in hash:\n\t\thash[key] += 1\n\telse:\n\t\thash[key] = 1\n \nmax = 0\nresults = []\nfor i, v in hash.items():\n\tif max == v:\n\t\tresults.append(i)\n\telif max < v:\n\t\tresults = [i]\n \nfor i in results:\n\tprint(i)\n', 'N = int(input())\n\nhash = {}\nfor i in range(N):\n\tkey = input()\n\tif key in hash:\n\t\thash[key] += 1\n\telse:\n\t\thash[key] = 1\n \nmax = 0\nresults = []\nfor i, v in hash.items():\n\tif max == v:\n\t\tresults.append(i)\n\telif max < v:\n\t\tresults = [i]\n\t\tmax = v\n \nfor i in results:\n\tprint(i)\n', 'N = int(input())\n\nhash = {}\nfor i in range(N):\n\tkey = input()\n\tif key in hash:\n\t\thash[key] += 1\n\telse:\n\t\thash[key] = 1\n \nmax = 0\nresults = []\nfor i, v in hash.items():\n\tif max == v:\n\t\tresults.append(v)\n\telif max < v::\n\t\tresults = [v]\n \nfor i in results:\n\tprint(v)\n', 'N = int(input())\n\nhash = {}\nfor i in range(N):\n\tkey = input()\n\tif key in hash:\n\t\thash[key] += 1\n\telse:\n\t\thash[key] = 1\n \nmax = 0\nresults = []\nfor i, v in hash.items():\n\tif max == v:\n\t\tresults.append(i)\n\telif max < v:\n\t\tresults = [i]\n\t\tmax = v\n\nresults.sort()\nfor i in results:\n\tprint(i)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s222169877', 's385718377', 's589680898', 's310443784'] | [32092.0, 32096.0, 3064.0, 32096.0] | [430.0, 517.0, 17.0, 632.0] | [277, 287, 278, 295] |
p02773 | u301624971 | 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 = [input() for i in range(N)]\nC = dict()\n\n\nfor i in range(N):\n a = input()\n if(a not in C.keys()):\n C[a] = 1\n else:\n val = C[a]\n C[a] = val + 1\n\nmaxv=0\nfor i in C.values():\n if(i > maxv):\n maxv=i\n\nans = sorted(C.items())\nfor i in ans:\n if(maxv==i[1]):\n print(i[0])', "\ndef myAnswer(N:int,S:list) -> None:\n dic = {}\n for s in S:\n if(s in dic.keys()):\n dic[s]+=1\n else:\n dic[s] = 1\n ans = []\n dic2 = sorted(dic.items(), key=lambda x:x[1],reverse = True)\n MAX = dic2[0][1]\n for key,value in dic2:\n if(MAX == value):\n ans.append(key)\n else:\n break\n ans.sort()\n for a in ans:\n print(a)\n\n\n\n\ndef main():\n N = int(input())\n S = [(input()) for _ in range(N)]\n myAnswer(N,S[:])\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s235260026', 's454530165'] | [17048.0, 48908.0] | [299.0, 650.0] | [335, 548] |
p02773 | u301984327 | 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\n\nd = collections.defaultdict(lambda:0)\n\nfor i in range(n):\n s = input()\n d[s] += 1\n\nd = dict(d)\n\na = collections.Counter(d).most_common()\n\nmost = 0\n\nfor k, v in a:\n if most <= v:\n most = v\n print(k)\n else:\n break', 'import collections\n\nn = int(input())\n\n\nd = collections.defaultdict(lambda:0)\n\nfor i in range(n):\n s = input()\n d[s] += 1\n\nd = dict(d)\n\na = collections.Counter(d)\n\nmost = 0\n\nfor k, v in a.items():\n if most <= v:\n most = v\n print(k)\n else:\n break', 'import collections\n\nn = int(input())\n\n\nd = collections.defaultdict(lambda:0)\n\nfor i in range(n):\n s = input()\n d[s] += 1\n\nd = dict(d)\n\na = collections.Counter(d).most_common()\n\nmost = a[0][1]\nans = []\n\nfor k, v in a:\n if v == most:\n ans.append(k)\n else:\n break\n\nans.sort()\n\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s073458403', 's544120391', 's570602605'] | [57604.0, 41944.0, 57704.0] | [660.0, 610.0, 855.0] | [283, 277, 326] |
p02773 | u303384315 | 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_sort = collections.Counter(s).most_common()\nlist_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]\nfor i in list_most:\n print(i)', 'import collections\n\nn = int(input())\ns = [input() for i in range(n)]\n\nc_sort = collections.Counter(s).most_common()\nlist_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]\nfor i in list_most:\n print(i)', 'import sys\n\ninput = sys.stdin.readline\n\nn = int(input())\ns = [input() for i in range(n)]\ndict = {}\n\nfor i in range(n):\n if s[i] not in dict:\n dict[s[i]], s.count(s[i])]\n\nmax_d_list = [d[0] for d in dict.items() if d[1] == max(dict.values())]\nsorted_list = sorted(max_d_list)\nfor i in sorted_list:\n print(i)', 'import sys\nfrom collections import Counter\n\ninput = sys.stdin.readline\n\nn = int(input())\ns = [input() for i in range(n)]\n\nc_sort = collections.Counter(s).most_common()\nlist_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]\nfor i in list_most:\n print(i)', 'import collections\n\nn = int(input())\ns = [input() for _ in range(n)]\nc_sort = collections.Counter(s).most_common()\nlist_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]\nfor i in sorted(list_most):\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s075103180', 's157067265', 's215425892', 's511312890', 's438947667'] | [45040.0, 45040.0, 2940.0, 17504.0, 45040.0] | [566.0, 542.0, 17.0, 58.0, 703.0] | [234, 235, 319, 287, 242] |
p02773 | u303739137 | 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 = [str(input()) for i in range(n)]\n\nset_key = set(s)\ndic = dict(set_key, [0]*len(set_key))\n\nfor c in s:\n dic[c] += 1\n \nn_max = max(dic.values())\nstr_argmax = dic.keys()[dic.values() == n_max]\nstr_argmax.sort()\n\nfor i in str_argmax:\n print(i)', 'n = int(input())\n \ns = [str(input()) for i in range(n)]\n\nset_key = list(set(s))\nset_key.sort()\ndic = dict(zip(set_key, [0]*len(set_key)))\n\nfor c in s:\n dic[c] += 1\n\nn_max = max(dic.values())\n\nfor c in set_key:\n if dic[c] == n_max:\n print(c)'] | ['Runtime Error', 'Accepted'] | ['s666485339', 's785745185'] | [29076.0, 46092.0] | [335.0, 809.0] | [265, 245] |
p02773 | u306412379 | 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)]\nlist1 = []\ncount = 1\nfor s in S:\n c = S.count(s)\n if c == count:\n list1.append(s)\n \n elif c > count:\n list1 = [s]\n count = c\n S.remove(s)\n \n \nif len(list1) == 1:\n print(list1[0])\nelif S.count(list1[0]) < S.count(list1[1]):\n list1.pop(0)\n for i in range(len(list1)):\n ans = sorted(list1)\n print(ans[i])', 'N = int(input())\nS = [input() for i in range(N)]\nlist1 = []\ncount = 1\nfor i in range(N):\n if S[i] not in list1:\n c = S.count(S[i])\n if c == count:\n list1.append(S[i])\n elif c > count:\n list1 = [S[i]]\n count = c\n \nif len(list1) == 1:\n print(list1[0])\nelif S.count(list1[0]) < S.count(list1[1]):\n list1.pop(0)\n for i in range(len(list1)):\n ans = sorted(list1)\n print(ans[i])', 'N = int(input())\ndic = {}\n\nfor i in range (N):\n s = input()\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\n\nsai = max(dic.values())\n\nfor j in sorted(k for k in dic if dic[k] == sai):\n print(j)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s717380167', 's907905955', 's429179914'] | [23400.0, 23392.0, 35300.0] | [2206.0, 2206.0, 454.0] | [380, 411, 201] |
p02773 | u307418002 | 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 cnt=dict()\n for _ in range(n):\n s=input()\n if s in cnt:\n cnt[s]+=1\n else :\n cnt[s]=1\n #print(cnt)\n \n a = [k for k, v in cnt.items() if v == max(cnt.values())]\n for elm in a :\n print(elm)\n\nmain()\n\n', 'import collections\n\ndef main():\n n =int( input())\n\n cnt=dict()\n for _ in range(n):\n s=input()\n if s in cnt:\n cnt[s]+=1\n else :\n cnt[s]=1\n #print(cnt)\n \n a = [k for k, v in cnt.items() if v == max(cnt.values())]\n print("aa")\n a.sort()\n for elm in a:\n print(elm)\n\nmain()\n\n', 'def main():\n n =int( input())\n\n cnt=dict()\n \n for _ in range(n):\n s=input()\n if s in cnt:\n cnt[s]+=1\n else :\n cnt[s]=1\n #print(cnt)\n \n num = 0\n res =[]\n for key,value in cnt.items():\n print(key,":::",value)\n if value > num:\n num=value\n res.append(key)\n elif value==num:\n res.append(key)\n\n #print("res::",res)\n\n \n \n\n\n \n res.sort()\n for elm in res:\n print(elm)\n\n\nmain()\n\n', 'def main():\n n =int( input())\n\n cnt=dict()\n \n for _ in range(n):\n s=input()\n if s in cnt:\n cnt[s]+=1\n else :\n cnt[s]=1\n #print(cnt)\n \n num = 0\n res =[]\n for key,value in cnt.items():\n #print(key,":::",value)\n if value > num:\n num=value\n res=[]\n res.append(key)\n\n elif value==num:\n res.append(key)\n\n #print("res::",res)\n\n \n \n\n\n \n res.sort()\n for elm in res:\n print(elm)\n\n\nmain()\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s403046787', 's450033753', 's524273607', 's129143142'] | [32480.0, 32480.0, 34524.0, 32096.0] | [2105.0, 2104.0, 842.0, 606.0] | [319, 347, 619, 640] |
p02773 | u307622233 | 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())\nstr_list = []\n\nfor count in range(n):\n str_list.append(input())\n\nlist_set = set(str_list)\n\n\n# print(str_list)\n# print(list_set)\n\n\n# print(str_list)\n# str_list = filter(lambda txt: txt != set_txt, str_list)\n# print(str_list)\n# print('!!!!!')\n\n\nmax = 0\nans = []\nfor set_txt in list_set:\n count = 0\n for list_txt in str_list:\n if(set_txt == list_txt):\n count += 1\n print(str_list)\n str_list = ([s for s in str_list if s != 'set_txt'])\n if(max < count):\n max = count\n ans.clear\n ans.append(set_txt)\n elif(max == count):\n ans.append(set_txt)\n print(count)\n\nans.sort()\nfor txt in ans:\n print('---' + txt)\n # print(txt)\n", 'n = int(input())\nstr_list = []\n\nfor count in range(n):\n str_list.append(input())\nset_list = set(str_list)\n\nmax = 0\nans = []\n\nfor txt in set_list:\n count = str_list.count(txt)\n if(max < count):\n max = count\n ans.clear\n ans.append(txt)\n elif(max == count):\n ans.append(txt)\n\nans.sort()\nfor txt in ans:\n print(txt)\n', "n = int(input())\ndict_str = {}\n\nfor count in range(n):\n txt = input()\n if(txt in dict_str):\n dict_str[txt] += 1\n else:\n dict_str[txt] = 1\n# print(dict_str)\n\nmax = max(dict_str.values())\n\nans = []\nans = [k for k, v in dict_str.items() if v == max]\n\nans.sort()\nfor txt in ans:\n # print(end='---')\n print(txt)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s002880716', 's709094653', 's303040256'] | [149860.0, 29076.0, 32092.0] | [2105.0, 2105.0, 639.0] | [706, 355, 335] |
p02773 | u308919961 | 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 operator import itemgetter\nimport datetime\n\nn = int(input())\nsn = dict()\n\nfor i in range(n):\n s = input()\n if(s in sn):\n sn[s] += 1\n else:\n sn[s] = 1\n\nsn = sorted(sn.items(), key=lambda x:x[1], reverse=True)\n#print(sn)\n\nmax_val = max(dict(sn).values())\n\nfor si in sn:\n if(int(si[1]) == max_val):\n print(si[0])\n else:\n break', 'from operator import itemgetter\nimport datetime\n\nn = int(input())\nsn = dict()\n\nfor i in range(n):\n s = input()\n if(s in sn):\n sn[s] += 1\n else:\n sn[s] = 1\n\nsn = sorted(sn.items(), key=lambda x:(-x[1],x[0]))\n#print(sn)\n\nmax_val = max(dict(sn).values())\n\nfor si in sn:\n if(int(si[1]) == max_val):\n print(si[0])\n else:\n break'] | ['Wrong Answer', 'Accepted'] | ['s477145718', 's598342523'] | [54224.0, 68688.0] | [628.0, 1006.0] | [371, 365] |
p02773 | u309120194 | 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\n\nN = int(input())\nS = [input() for _ in range(N)]\n \nT = sorted(set(S))\nt = len(T)\nl = [S.count(T[i]) for i in range(t)]\n \nfor i in range(t):\n if l[i] == max(l):\n print(T[i])', 'N = int(input())\nS = [input() for _ in range(N)]\n\nT = list(set(S))\nt = len(T)\nl = [0] * t\n\nfor i in range(t):\n l[i] = S.count(T[i])\n \nfor i in range(t):\n if l[i] == max(l):\n print(T[i])', 'N = int(input())\nS = [input() for _ in range(N)]\n\n\n\n \n\ndic = {}\nfor i in range(N):\n s = S[i]\n if s not in dic: dic[s] = 1\n else: dic[s] += 1\n\nmax_count = max(dic.values()) \n \n\nl = [key for key in dic.keys() if dic[key] == max_count]\n \n\nfor i in sorted(l):\n print(i)'] | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s318132009', 's323972909', 's196261648'] | [35720.0, 35748.0, 38444.0] | [2206.0, 2206.0, 480.0] | [216, 191, 578] |
p02773 | u309423187 | 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)]\nans = []\n\nc = Counter(s)\nmax_count = max(c.values())\n\nfor k, v in c.items():\n if v == max_count:\n ans.append(k)\nans.sort()\nprint('\\\uffffn'.join(ans))\n", "from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\nans = []\n\nc = Counter(s)\nmax_count = max(c.values())\n\nfor k, v in c.items():\n if v == max_count:\n ans.append(k)\n\nans.sort()\n\nprint('\\n'.join(ans))\n"] | ['Wrong Answer', 'Accepted'] | ['s456153258', 's079896656'] | [40052.0, 35952.0] | [522.0, 523.0] | [239, 239] |
p02773 | u311113280 | 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)]\nmaxA=0\nB=[]\nfor i in set(S):\n A=(S.count(i))\n if A > maxA:\n maxA=A\n B = [i]\n if A == maxA and i not in B:\n B.append(i)\n[print(j) for j in B]', 'N=int(input())\nS = [input() for _ in range(N)]\nimport collections \nC=collections.Counter(S)\nmaxC=max(C.values())\nkeys = [k for k, v in C.items() if v == maxC]\n[print(j) for j in sorted(keys)]'] | ['Wrong Answer', 'Accepted'] | ['s311156036', 's918561341'] | [29076.0, 35980.0] | [2105.0, 630.0] | [199, 191] |
p02773 | u312025627 | 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 N = int(input())\n S = [input() for i in range(N)]\n from collections import Counter\n c = Counter(S)\n cnt = c.most_common()[0][1]\n for s in c.most_common():\n # print(s)\n if s[1] == cnt:\n print(s[0])\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n N = int(input())\n S = [input() for i in range(N)]\n from collections import Counter\n c = Counter(S)\n cnt = c.most_common()[0][1]\n ans = []\n for s in c.most_common():\n # print(s)\n if s[1] == cnt:\n ans.append(s[0])\n ans.sort()\n for a in ans:\n print(a)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s059525328', 's592016667'] | [46892.0, 45068.0] | [551.0, 793.0] | [293, 361] |
p02773 | u312078744 | 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())\ndata = [0] * N\n\n\nfor i in range(0, N):\n data[i] = input()\n\ncount = Counter(data)\n\n\nmost = count.most_common()\nmostNum = most[0][1]\nprint(count) # counter_object\nprint(most) # list;[(val,num),(val,num),/////]\nprint(mostNum) # number of most\n\nmost.sort()\n\nfor i in most:\n if (i[1] == mostNum):\n print(i[0])\n', "from collections import Counter\nN = int(input())\ndata = [0] * N\n\n\nfor i in range(0, N):\n data[i] = input()\n\ncount = Counter(data)\n\n\nmost = count.most_common()\nmostNum = most[0][1]\n'''\nprint(count) # counter_object\nprint(most) # list;[(val,num),(val,num),/////]\nprint(mostNum) # number of most\n'''\nmost.sort()\n\nfor i in most:\n if (i[1] == mostNum):\n print(i[0])\n"] | ['Wrong Answer', 'Accepted'] | ['s127922061', 's995740579'] | [72096.0, 46856.0] | [1084.0, 828.0] | [439, 446] |
p02773 | u314877220 | 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())\nwords = [input() for i in range(n)]\nwords_set = set(words)\ncounter = [0 for j in range(int(len(words_set)))]\nwords_dic = {}\n\nwords_list = list(zip(words_set, counter))\nwords_dic = dict(words_list)\n\nfor k in words:\n words_dic[k] = words_dic[k] + 1\nfin = [ii[0] for ii in words_dic.items() if ii[1] == max(words_dic.values())]\nfin.sort\nfor jj in fin:\n print(jj)', 'from collections import Counter\nn = int(input())\nwords = [input() for i in range(n)]\n\ncounter = Counter(words).most_common()\nans =[]\nfor i in range(int(len(counter))):\n if counter[0][1] > counter[i][1]:\n break\n ans.append(counter[i][0])\nans.sort()\n\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s895353382', 's760783598'] | [65548.0, 45040.0] | [2106.0, 690.0] | [382, 288] |
p02773 | u317779196 | 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)]\nc = collections.Counter(s)\nl = [i for i,v in c.items() if v == max(c.values())]\nfor j in l:\n print(j)', 'import collections\nn = int(input())\ns = [input() for _ in range(n)]\nc = collections.Counter(s)\nmv = c.most_common()[0][1]\nl = [i for i,v in c.items() if v == mv]\nl.sort()\nfor j in l:\n print(j)'] | ['Wrong Answer', 'Accepted'] | ['s319693355', 's481513119'] | [35572.0, 45116.0] | [2105.0, 651.0] | [171, 195] |
p02773 | u318662224 | 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. | ['d = {}\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())\nfor s in sorted(k for k in d if d[k] == m):\n print(s)', 'from collections import Counter\n\nN = int(input())\n\nd = {}\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())\nfor s in sorted(k for k in d if d[k] == m):\n print(s)\n'] | ['Runtime Error', 'Accepted'] | ['s238130520', 's936696655'] | [9108.0, 35612.0] | [26.0, 471.0] | [179, 231] |
p02773 | u319345083 | 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 _ in range(n)]\nmost_list = []\ncounter_dict = {}\nfor s in s_list:\n if s in counter_dict:\n counter_dict[s] += 1\n else:\n counter_dict[s] = 1\n\nsorted_counter = sorted(counter_dict.items(), key=lambda x: x[1], reverse=True)\nans = []\nmax_num = sorted_counter[0][1]\nfor c in sorted_counter:\n if max_num == c[1]:\n ans.append(c[0])\n else:\n break\n\nprint('\\n'.join(ans))\n", "n = int(input())\ns_list = [input() for _ in range(n)]\nmost_list = []\ncounter_dict = {}\nfor s in s_list:\n if s in counter_dict:\n counter_dict[s] += 1\n else:\n counter_dict[s] = 1\n\nsorted_counter = sorted(counter_dict.items(), key=lambda x: x[1], reverse=True)\nans = []\nmax_num = sorted_counter[0][1]\nfor c in sorted_counter:\n if max_num == c[1]:\n ans.append(c[0])\n else:\n break\n\nans.sort()\nprint('\\n'.join(ans))\n"] | ['Wrong Answer', 'Accepted'] | ['s006080069', 's427654592'] | [49936.0, 49932.0] | [473.0, 667.0] | [439, 450] |
p02773 | u319589470 | 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 = {}\nans = []\nfor i in range(n):\n s = input()\n if s not in d:\n d[s] = 1\n else:\n d[s] += 1\nd_sorted = sorted(d.items(), key=lambda x:x[1])\nd = list(d.items())\nscore = d[-1][1]\nfor i in range(len(d)):\n if score == d[i][1]:\n ans.append(d[i][0])\nans.sort()\nfor i in range(len(ans)):\n print(ans[i])', 'n = int(input())\nd = {}\nans = []\nfor i in range(n):\n s = input()\n if s not in d:\n d[s] = 1\n else:\n d[s] += 1\nd = sorted(d.items(), key=lambda x:x[1])\nscore = d[-1][1]\nans = []\nfor i in range(len(d)):\n if d[i][1] == score:\n ans.append(d[i][0])\nans.sort()\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Accepted'] | ['s411436242', 's760261141'] | [55900.0, 43228.0] | [778.0, 745.0] | [326, 308] |
p02773 | u323859575 | 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 = [''] * n\nfor i in range(n):\n print(i)\n s[i] = input()\n\ncs = collections.Counter(s)\nmcs = cs.most_common()\ncnt = mcs[0][1]\n\nfcs = [i[0] for i in cs.items() if i[1] == cnt]\nans = sorted(fcs)\nfor s in ans:\n print(s)\n", "import collections\n\nn = int(input())\ns = [''] * n\nfor i in range(n):\n s[i] = input()\n\ncs = collections.Counter(s)\nmcs = cs.most_common()\ncnt = mcs[0][1]\n\nfcs = [i[0] for i in cs.items() if i[1] == cnt]\nans = sorted(fcs)\nfor s in ans:\n print(s)\n"] | ['Wrong Answer', 'Accepted'] | ['s218574998', 's738689962'] | [51840.0, 51872.0] | [901.0, 463.0] | [263, 250] |
p02773 | u327532412 | 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 range(N))\nm = max(S.values())\nfor v in sorted(s for k, v in S.items() if k == m):\n\tprint(v)', 'from collections import Counter\nN = int(input())\nS = Counter(input() for _ in range(N))\nm = max(S.values())\nfor v in sorted(s for k, v in S.items() if v == m):\n\tprint(v)', 'from collections import Counter\nN = int(input())\nS = Counter(input() for _ in range(N))\nm = max(S.values())\nfor v in sorted(k for k, v in S.items() if v == m):\n\tprint(v)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s443113228', 's887646916', 's691205421'] | [32480.0, 32480.0, 32480.0] | [331.0, 332.0, 659.0] | [169, 169, 169] |
p02773 | u327721369 | 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())\nst=[]\nl=[0 for i in range(n)]\nfor i in range(n):\n st.append(input())\nfor i in range(n):\n if st[i] not in l:\n l[i]+=1\n if i==n-1:break\n for j in range(i+1,n):\n if st[i]==st[j]:\n l[i]+=1\nm=max(l)\nif m==1:\n for i in range(n):\n print(st[i])\nelse:\n s=[]\n for i in range(n):\n if m==l[i]:\n s.append(st[i])\n for word in sorted(l):\n print(word)', 'n=int(input())\na=[]\nfor i in range(n):\n a.append(input())\na.sort()\nd={}\nfor i in range(n):\n if a[i] not in d:\n d[a[i]]=1\n else:\n d[a[i]]+=1\nall_values=d.values()\nm=max(all_values)\nl=[]\nfor i in d:\n if d[i]==m:\n l.append(i)\nl.sort()\nfor i in l:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s182131075', 's552424402'] | [20384.0, 35208.0] | [2105.0, 861.0] | [431, 288] |
p02773 | u328755070 | 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 x in range(N)]\nS.sort()\n\nT = [[S[0]]]\nfor i in S[1:N]:\n if i == T[-1][-1]:\n T[-1].append(i)\n else:\n T.append([i])\nT.sort(key=lambda x: len(x))\nU = []\n\nU.append(T[-1][0])\nc = -2\nfor i in T[0:len(T)-1]:\n if len(i) == len(T[-1]):\n U.append(i[0])\n else:\n break\n\n\nU.sort()\nfor x in U:\n print(x)\n', 'N = int(input())\nS = [input() for x in range(N)]\nS.sort()\n\nT = [[S[0]]]\nfor i in S[1:N]:\n if i == T[-1][-1]:\n T[-1].append(i)\n else:\n T.append([i])\nT.sort(key=lambda x: len(x))\nU = []\n\nfor i in T[::-1]:\n if len(i) == len(T[-1]):\n U.append(i[0])\n else:\n break\n\nU.sort()\nfor x in U:\n print(x)\n'] | ['Wrong Answer', 'Accepted'] | ['s600282932', 's503932071'] | [42020.0, 42020.0] | [815.0, 788.0] | [341, 308] |
p02773 | u329407311 | 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())\narr = []\n\nfor i in range(N):\n a = input()\n arr.append(a)\n \narr.sort()\narr.append("")\n\na = [[] for i in range(N)]\ncnt = 0\n\nfor i in range(1,N+1):\n \n if arr[0] != arr[1] and i == 1:\n a[0].append(arr[0])\n \n if arr[i] == arr[i-1]:\n cnt += 1\n else:\n if cnt > 0:\n a[cnt].append(arr[i])\n else:\n cnt = 0\n a[cnt].append(arr[i])\nfor i in range(N):\n if a[i] == []:\n p = 0\n else:\n b = a[i]\n b.sort()\n for j in b:\n if j != "":\n print(j)\n break\n \n ', 'N = int(input())\narr = []\n\nfor i in range(N):\n a = input()\n arr.append(a)\n \narr.sort()\narr.append("")\n\na = [[] for i in range(N+1)]\ncnt = 0\n\nfor i in range(1,N+1):\n \n if arr[0] != arr[1] and i == 1:\n a[1].append(arr[0])\n \n if arr[i] == arr[i-1]:\n if cnt == 0:\n cnt += 1\n cnt += 1\t\n else:\n if cnt > 1:\n a[cnt].append(arr[i-1])\n cnt = 1\n else:\n cnt = 1\n if arr[0] != arr[i-1]:\n a[1].append(arr[i-1])\nfor i in range(N):\n if a[N-i] == []:\n p = 0\n else:\n b = a[N-i]\n b.sort()\n for j in b:\n if j != "":\n print(j)\n break'] | ['Wrong Answer', 'Accepted'] | ['s039578086', 's608928030'] | [34888.0, 35016.0] | [735.0, 897.0] | [517, 597] |
p02773 | u329785342 | 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\nchars = [input() for _ in range(N)]\nchar_counts = collections.Counter(chars)\n\nfor char in sorted(char_counts.most_common()):\n print(char[0])', 'import collections\n\nN = int(input())\n\nchars = [input() for _ in range(N)]\nchar_counts = collections.Counter(chars)\n\nmax_count = max(char_counts.values())\nmax_count_chars = sorted([key for key, value in char_counts.items() if value == max_count])\n\nfor char in max_count_chars:\n print(char)'] | ['Wrong Answer', 'Accepted'] | ['s981081471', 's023712868'] | [47636.0, 35572.0] | [819.0, 606.0] | [179, 289] |
p02773 | u330661451 | 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\ndef main():\n n = int(input())\n s = [input() for _ in range(n)]\n C = Counter(s)\n cl = C.most_common()\n print(cl)\n mx = cl[0][1]\n ans = []\n for c in cl:\n if (c[1] == mx):\n ans.append(c[0])\n else:\n break\n ans.sort()\n for i in ans:\n print(i)\n\n\nif __name__ == "__main__":\n main()', 'from collections import Counter\n\ndef main():\n n = int(input())\n s = [input() for _ in range(n)]\n C = Counter(s)\n mx = max(C.values())\n ans = []\n for k,v in C.items():\n if v == mx:\n ans.append(k)\n ans.sort()\n print("\\n".join(ans))\n\n\nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s043909110', 's360907760'] | [55168.0, 35936.0] | [805.0, 541.0] | [383, 311] |
p02773 | u334365640 | 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())\nm = {}\nfor i in n:\n s = input()\n if s in m:\n m[s] += 1\n else:\n m[s] = 1\n \nmaxim = max(m.values())\nmySet = set(key if value == maxim for key, value in m.items())\nfor i in mySet:\n print(i)\n ', 'n = int(input())\nm = {}\nfor i in range(n):\n s = input()\n if s in m:\n m[s] += 1\n else:\n m[s] = 1\n\nmaxim = max(m.values())\nmySet = set(key for key, value in m.items() if value == maxim)\nfor i in sorted(mySet):\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s466568163', 's367260294'] | [2940.0, 44124.0] | [17.0, 665.0] | [219, 243] |
p02773 | u337626942 | 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)\nc=c.most_common()\nl2=[]\n \nM=c.[0][1]\nfor i in range(N):\n if c.[i][1]==M:\n l2.append(c.[i][0])\n else:\n break\nl2.sort()\nfor j in range(len(l2)):\n print(l2[j])', 'import collections\nN=int(input())\nl=[input() for i in range(N)]\nc=collections.Counter(l)\nc=c.most_common()\nl2=[]\n \nM=c.[0][1]\nfor i in range(len(c)):\n if c.[i][1]==M:\n l2.append(c.[i][0])\n else:\n break\nl2.sort()\nfor j in range(len(l2)):\n print(l2[j])', 'N=int(input())\ndic={}\nfor i in range(N):\n s=input()\n if s in dic:\n dic[s]+=1\n else:\n dic[s]=0\nm=max(dic[i] for i in dic)\nans=[]\nfor j in dic:\n if dic[j]==m:\n ans.append(j)\nans.sort()\nfor k in range(len(ans)):\n print(ans[k])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s009538020', 's771595718', 's505569037'] | [2940.0, 2940.0, 32096.0] | [17.0, 17.0, 686.0] | [268, 273, 259] |
p02773 | u337713602 | 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 = {}\nfor i in range(n):\n t = input()\n if t in d.keys():\n d[t] += 0\n else:\n d[t] = 0\n\ns = sorted(list(set(d.keys())))\nm = max(d.values())\n\nfor s in s:\n if d[s] == m:\n print(s)', 'n = int(input())\n\nd = {}\nfor i in range(n):\n t = input()\n if t in d.keys():\n d[t] += 1\n else:\n d[t] = 0\n\ns = sorted(list(set(d.keys())))\nm = max(d.values())\n\nfor s in s:\n if d[s] == m:\n print(s)\n'] | ['Wrong Answer', 'Accepted'] | ['s936499830', 's046303449'] | [42332.0, 42460.0] | [688.0, 720.0] | [207, 208] |
p02773 | u339443002 | 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())\ncounts = defaultdict(int)\n\nfor _ in range(n):\n counts[input().strip()] += 1\n\nvec = sorted([(-value, key) in counts.items()], reverse=True)\nbest = vec[0][0]\nfor v, s in vec:\n if v != best:\n break\n print(s)\n', 'from collections import defaultdict\n\nn = int(input())\ncounts = defaultdict(int)\n\nfor _ in range(n):\n counts[input().strip()] += 1\n\nvec = sorted([(value, key) for key, value in counts.items()])\nbest = vec[-1][0]\nkeys = sorted([key for value, key in vec if value == best])\nfor key in keys:\n print(key)'] | ['Runtime Error', 'Accepted'] | ['s672560496', 's355850015'] | [32480.0, 46880.0] | [424.0, 1055.0] | [275, 305] |
p02773 | u344030307 | 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())\n\nd = {}\n\nfor i in range(n):\n a = input()\n if a not in d:\n d[a] = 1\n else:\n d[a] += 1\n\ndsorted = sorted(d, key=lambda x:x[1])\n\ncnt = 0\nfor i in dsorted:\n print(i)\n cnt += 1\n if cnt == 2:\n break', 'n = int(input())\n\nd = {}\n\nfor i in range(n):\n a = input()\n if a not in d:\n d[a] = 1\n else:\n d[a] += 1\n\ndsorted = sorted(d.items(), key=lambda x:x[1], reverse=True)\n\nname = []\ncnt = dsorted[0][1]\n\nfor i in dsorted:\n if i[1] == cnt:\n name.append(i[0])\n else:\n break\n\nname.sort()\n\nfor i in name:\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s164670362', 's473381401'] | [35448.0, 48384.0] | [288.0, 497.0] | [225, 320] |
p02773 | u344813796 | 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=[str(input()) for _ in range(n)]\nimport collections\ncnt=collections.Counter(s)\ncntt=cnt.most_common()\nmaxn=cntt[0][1]\nfor c in cntt:\n if c[1]==maxn:\n print(c[0])\n else:\n break', 'n=int(input())\ns=[str(input()) for _ in range(n)]\nimport collections\ncnt=collections.Counter(s)\ncntt=cnt.most_common()\nmaxn=cntt[0][1]\nansl=[]\nfor c in cntt:\n if c[1]==maxn:\n ansl.append(c[0])\n else:\n break\nansl.sort()\nfor i in ansl:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s816244595', 's973448663'] | [49648.0, 50444.0] | [389.0, 522.0] | [200, 252] |
p02773 | u345483150 | 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().split()\nc=collections.Counter(s)\nk=list(c.most_common())\n#print(k[0][0])\ncnt=0\nfor i in range(n):\n if k[i][1]>cnt:\n cnt=k[i][1]\n l=[k[i][0]]\n elif k[i][1]==cnt:\n l.append(k[i][0])\n else:\n break \nfor i in l:\n print(i)', 'from collections import Counter\nn=int(input())\ns=input().split()\nk=collections.Counter(s).c.most_common()\nl=[]\nfor i in k:\n if i[1]==i[0][1]:\n l.append(i[0])\nl.sort()\nfor i in l:\n print(i)', 'import collections\nn=int(input())\ns=list(map(str,input().split()))\nk=collections.Counter(s).c.most_common()\nl=[]\nfor i in k:\n if i[1]==i[0][1]:\n l.append(i[0])\nl.sort()\nfor i in l:\n print(i)', 'import collections\nn=int(input())\ns=input().split()\nk=collections.Counter(s).c.most_common()\nl=[]\nfor i in k:\n if i[1]==i[0][1]:\n l.append(i[0])\nl.sort()\nfor i in l:\n print(i)', 'from collections import Counter\nn=int(input())\ns=input().split()\nc=collections.Counter(s)\nk=list(c.most_common())\ncnt=0\nfor i in range(n):\n if k[i][1]>cnt:\n cnt=k[i][1]\n l=[k[i][0]]\n elif k[i][1]==cnt:\n l.append(k[i][0])\n else:\n break \nfor i in l:\n print(i)', 'import collections\nn=int(input())\ns=input().split()\nc=collections.Counter(s)\nk=list(c.most_common())\ncnt=0\nfor i in range(n):\n if k[i][1]>cnt:\n cnt=k[i][1]\n l=[k[i][0]]\n elif k[i][1]==cnt:\n l.append(k[i][0])\n else:\n break \nfor i in l:\n print(i)', 'import collections\n\nN=int(input())\nS=[]\nfor i in range(N):\n\tS.append(input())\nM=collections.Counter(S)\nA=max(M.values())\ntmp=[]\nfor i,j in M.items():\n\tif j==A:\n\t\ttmp.append(i)\nans=sorted(tmp)\nfor i in range(len(ans)):\n\tprint(ans[i])'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s144223679', 's297619810', 's380479799', 's550797853', 's638377983', 's762374725', 's577332501'] | [3316.0, 3316.0, 3316.0, 3316.0, 3316.0, 3316.0, 35572.0] | [21.0, 20.0, 21.0, 22.0, 21.0, 21.0, 699.0] | [313, 200, 202, 187, 297, 284, 232] |
p02773 | u346424924 | 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\nd = {}\nfor i in range(n):\n if s[i] in d:\n d[s[i]] += 1\n else:\n d[s[i]] = 1\n\nd_s = sorted(d.items(), key=lambda x: x[1])\n\nma = [m[0] for m in d.items() if m[1] == max(d.values())]\nprint(*sorted(ma))', 'from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\n\nd = Counter(s)\n\nma = [m[0] for m in d.items() if m[1] == max(d.values())]\nprint(*sorted(ma))', 'from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\n\nd = Counter(s).most_common()\n\ns = d[0][1]\nans = []\nfor k, v in d:\n if s == v:\n ans.append(k)\n else:\n break\nprint(*sorted(ans), sep="\\n")'] | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s242834514', 's612857445', 's092379151'] | [46924.0, 35568.0, 45044.0] | [2106.0, 2105.0, 664.0] | [267, 174, 238] |
p02773 | u347600233 | 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 for i in range(n)]\ndics = {}\nfor i in range(n):\n try:\n s = input()\n a = dics[s]\n dics[s] += 1\n except KeyError:\n dics[s] = 1\nmax_v = max(dics.values())\nmax_k_list = [kv[0] for kv in dics.items() if kv[1] == max(dics.values())]\nfor i in max_k_list:\n print(i)', "from collections import Counter\nn = int(input())\ns = Counter([input() for i in range(n)])\nmax_s = max(s.values()) \nprint(*sorted(k for k, v in s.items() if v == max_s), sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s455591249', 's790287344'] | [35088.0, 38892.0] | [2109.0, 386.0] | [318, 178] |
p02773 | u347640436 | 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 = {}\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())\nfor s in sorted(d[k] for k in d if d[k] == m):\n print(s)\n', 'N = int(input())\n\nd = {}\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)\nl = []\nfor k in d:\n v = d[k]\n if v != m:\n continue\n l.append(v)\n\nfor s in sorted(l):\n print(s)\n', 'N = int(input())\n\nd = {}\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())\nfor s in sorted(k for k in d if d[k] == m):\n print(s)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s379587894', 's743791709', 's089249524'] | [32096.0, 32096.0, 32096.0] | [498.0, 354.0, 643.0] | [201, 253, 198] |
p02773 | u347920118 | 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={}\nans =[]\n \n"""for i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\nprint(l)"""\nfor i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\n#print(l)\nmax = max(l.values())\nprint(max)\nfor i in l:\n #print(l[i])\n if l[i]==num:\n ans.append(i)\nb = sorted(ans)\nfor i in b:\n print(i)\n', 'N=int(input())\nl={}\nans =[]\n \n"""for i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\nprint(l)"""\nfor i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\n#print(l)\nnum = max(l.values())\nprint(max)\nfor i in l:\n #print(l[i])\n if l[i]==num:\n ans.append(i)\nb = sorted(ans)\nfor i in b:\n print(i)\n', 'N=int(input())\nl={}\nans =[]\n \n"""for i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\nprint(l)"""\nfor i in range(N):\n s=input()\n if s in l:\n l[s]+=1\n else:\n l[s]=1\n#print(l)\nnum = max(l.values())\n#print(max)\nfor i in l:\n #print(l[i])\n if l[i]==num:\n ans.append(i)\nb = sorted(ans)\nfor i in b:\n print(i)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s092891456', 's704590776', 's609796467'] | [32096.0, 32988.0, 32988.0] | [373.0, 674.0, 675.0] | [360, 360, 361] |
p02773 | u349724238 | 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())\n\nimport collections\nimport itertools\ncounter = collections.Counter(S)\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 = int(input())\nS = []\nfor i in range(N):\n S.append(input())\nA = []\nfrom collections import Counter\nd = Counter(S)\nmd = d.most_common(1)[0][1]\nfor key, value in d.items():\n if value == md:\n A.append(key)\nAs = sorted(A)\nfor a in As:\n print(a)'] | ['Wrong Answer', 'Accepted'] | ['s811549544', 's622533698'] | [45324.0, 35476.0] | [620.0, 670.0] | [283, 258] |
p02773 | u350248178 | 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=[input() for i in range(n)]\nimport collections\nc=collections.Counter(l)\nll=c.most_common()\ntmp=ll[0][1]\nans=[]\nfor i,j in ll:\n if tmp==j:\n ans.append(i)\n else:\n ans.sort()\n print('\\n'.join(map(str,ans)))\n print(1)\n break\nans.sort()\nprint('\\n'.join(map(str,ans)))\n\n", "n=int(input())\nl=[input() for i in range(n)]\nimport collections\nc=collections.Counter(l)\nll=c.most_common()\ntmp=ll[0][1]\nans=[]\nfor i,j in ll:\n if tmp==j:\n ans.append(i)\n else:\n break\nans.sort()\nprint('\\n'.join(map(str,ans)))\n"] | ['Wrong Answer', 'Accepted'] | ['s527501263', 's243439014'] | [50308.0, 50308.0] | [639.0, 623.0] | [322, 246] |
p02773 | u350578302 | 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)]\nprint_list = []\ncount = []\nS_max = 0\n\nfor i in range(N):\n\tS_count = S.count(S[i])\n\tif S_max <= S_count:\n\t\tS_max = S_count\n\t\tprint_list.append(S[i])\n\nfor i in range(len(print_list)):\n\tprint(sorted(print_list)[i])', 'import collections\nS_print = []\nN=int(input())\nS=[input() for i in range(N)]\nS = collections.Counter(S)\n\nS_common = S.most_common()\n\nfor i in range(len(S_common)):\n\tif S_common[0][1] == S_common[i][1]:\n\t\tS_print.append(S_common[i][0])\n\nsorted(S_print)\nfor i in range(len(S_print)):\n\tprint(S_print[i])', 'import collections\nS_print = []\nN=int(input())\nS=[input() for i in range(N)]\nS = collections.Counter(S)\n\nS_common = S.most_common()\n#print(S_common)\n\nfor i in range(len(S_common)):\n\tif S_common[0][1] == S_common[i][1]:\n\t\tS_print.append(S_common[i][0])\n\nfor i in range(len(sorted(S_print))):\n\tprint(S_print[i])', 'import collections\n\nN=int(input())\nS=[input() for i in range(N)]\nS = sorted(collections.Counter(S))\n\nprint_list = []\ncount = []\nS_max = 0\n\nS_common = S.most_common()\n#print(S_common)\n\nvalues, counts = zip(*S_common)\n#print(counts[0])\n\nfor i in range(len(values)):\n\tif counts[0] == counts[i]:\n\t\tprint(values[i])\n', 'import collections\n\nN=int(input())\nS=[input() for i in range(N)]\nS = collections.Counter(S)\n\nprint_list = []\ncount = []\nS_max = 0\n\nS_common = S.most_common()\n#print(S_common)\n\nvalues, counts = zip(*S_common)\n\n#print(counts[0])\n\nfor i in range(len(values)):\n\tif counts[0] == counts[i]:\n\t\tprint(values[i])\n', 'import collections\n\nN=int(input())\nS=[input() for i in range(N)]\nS = collections.Counter(S)\n\nprint_list = []\ncount = []\nS_max = 0\n\nS_common = S.most_common()\n#print(S_common)\n\nvalues, counts = zip(*S_common)\nvalues = sorted(values)\n#print(counts[0])\n\nfor i in range(len(values)):\n\tif counts[0] == counts[i]:\n\t\tprint(values[i])\n', 'import collections\nS_print = []\nN=int(input())\nS=[input() for i in range(N)]\nS = collections.Counter(S)\n\nS_common = S.most_common()\n\nfor i in range(len(S_common)):\n\tif S_common[0][1] == S_common[i][1]:\n\t\tS_print.append(S_common[i][0])\n\nS_print_new = sorted(S_print)\n#print(S_print_new)\nfor i in range(len(S_print_new)):\n\tprint(S_print_new[i])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s089093999', 's198012854', 's351675251', 's604040928', 's896731299', 's960095478', 's416529524'] | [19100.0, 47672.0, 47664.0, 35572.0, 59348.0, 59348.0, 47612.0] | [2104.0, 860.0, 838.0, 556.0, 677.0, 890.0, 850.0] | [256, 300, 309, 311, 304, 327, 342] |
p02773 | u357230322 | 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=input()\n s.append(S)\n\nc = collections.Counter(s)\nprint(c.most_common()[0][0])\nfor i in range(1,n):\n if c.most_common()[i-1][1]==c.most_common()[i][1]:\n print(c.most_common()[i][0])\n else:\n break', 'import collections\nn=int(input())\ns=[]\nfor i in range(n):\n S=input()\n s.append(S)\n\nc = collections.Counter(s)\nl=c.most_common()\nprint(l[0][0])\nfor i in range(1,n):\n if l[i-1][1]==l[i][1]:\n print(l[i][0])\n else:\n break', 'import collections\nn=int(input())\ns=[]\nfor i in range(n):\n S=input()\n s.append(S)\n\nc = collections.Counter(s)\nl=c.most_common()\nprint(l[0][0])\nfor i in range(1,n):\n if l[i-1][1]==l[i][1]:\n print(l[i][0])\n else:\n break', 'import collections\nn=int(input())\ns=[]\nfor i in range(n):\n S=input()\n s.append(S)\n\nc = collections.Counter(s)\nl=c.most_common()\nx=[l[0][0]]\nfor i in range(1,len(l)):\n if l[i-1][1]==l[i][1]:\n x.append(l[i][0])\n else:\n break\nx.sort() \nfor i in x:\n print(i)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s284167743', 's354505360', 's621478166', 's035076774'] | [45040.0, 46964.0, 46888.0, 47672.0] | [2106.0, 619.0, 611.0, 792.0] | [265, 227, 227, 268] |
p02773 | u357751375 | 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 = list(input() for i in range(n))\ns = sorted(s)\nc = collections.Counter(s)\np = max(c.values())\ns = list(set(s))\n\nfor i in range(len(s)):\n if c[s[i]] == p:\n print(s[i])', 'from collections import Counter\nn = int(input())\ns = list(input() for i in range(n))\nc = Counter(s)\nm = max(c.values())\ns = sorted(list(set(s)))\nfor i in range(len(s)):\n if c[s[i]] == m:\n print(s[i])\n'] | ['Wrong Answer', 'Accepted'] | ['s692756479', 's910117446'] | [48712.0, 48700.0] | [511.0, 512.0] | [216, 210] |
p02773 | u366886346 | 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())\nb=0\nc=0\nlist=[]\nlist2=[]\nfor i in range(n):\n s=input()\n list.append(s)\nfor x in list:\n b=list.count(x)\n if b>=c:\n c=b\nfor x in list:\n if c==list.count(x):\n list2.append(x)\nfor x in list2:\n if list2.count(x)>=2:\n list2.remove(x)\nfor x in list2:\n print(x)', 'from collections import Counter\nn=int(input())\nlist=[input() for _ in range(n)]\nlist.sort()\nc=Counter(list).most_common()\nmost=c[0][1]\nc.sort()\nfor i in range(len(c)):\n if c[i][1]==most:\n print(c[i][0])\n'] | ['Wrong Answer', 'Accepted'] | ['s469973851', 's530410144'] | [18944.0, 45088.0] | [2105.0, 1015.0] | [310, 213] |
p02773 | u368579103 | 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 = [input() for i in range(n)]\ni = 0\ncount, yo = [], []\n\nwhile not(x == []):\n a = x.count(x[i])\n count.append(a)\n yo.append(x[i])\n x.remove(x[i])\n \nfor k, c in enumerate(count):\n if c == max(count):\n print(yo[k])\n\n\n\n\n', 'import collections\nn = int(input())\ns = [input() for i in range(n)]\ns = collections.Counter(s)\nm = 0\nans = []\n\nfor i in s.values():\n m = max(m,i)\n\nfor k, j in s.items():\n if j == m:\n ans.append(k)\nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])\n#print(*ans, sep = "\\n")\n'] | ['Wrong Answer', 'Accepted'] | ['s970428893', 's670187697'] | [17052.0, 35572.0] | [2108.0, 675.0] | [244, 281] |
p02773 | u369796672 | 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 range(H)]\n \nc = collections.Counter(l)\n \nL = c.most_common()\n \nvalues, counts = zip(*c.most_common())\n \nA = list(values)\nB = list(counts)\n \nb = B.count(B[0])\n \na = A[0:b + 1]\n \nfor i in a[0:]:\nprint(i)', 'import collections\n\nN = int(input())\nl = [input() for _ in range(N)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\na = A[0:b + 1]\n\nfor i in a[0:]:\nprint(i)', 'import collections\n \nN = int(input())\nl = [input() for _ in range(N)]\n \nc = collections.Counter(l)\n \nL = c.most_common()\n \nvalues, counts = zip(*c.most_common())\n \nA = list(values)\nB = list(counts)\n \nb = B.count(B[0])\n \na = A[0:b]\n \nfor i in a[0:]:\n\t\tprint(i)', 'from collections import Counter\n\nN = int(input())\nL = [input() for _ in range(N)]\n\n', 'import collections\n\nN = int(input())\nl = [input() for _ in range(N)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\na = A[0:b + 1]\n\nfor i in a[0:]:\nprint(i)', 'import collections\n\nN = int(input())\nl = [input() for _ in range(H)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\na = A[0:b + 1]\n\nfor i in a[0:]:\nprint(i)', 'import collections\n\nN = int(input())\nl = [input() for _ in range(N)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nprint("a")', 'import collections\n\nN = int(input())\nl = [input() for _ in range(N)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\n', 'import collections\n \nN = int(input())\nl = [input() for _ in range(N)]\n \nc = collections.Counter(l)\n \nL = c.most_common()\n \nvalues, counts = zip(*c.most_common())\n \nA = list(values)\nB = list(counts)\n \nb = B.count(B[0])\n \na = A[0:b + 1]\n \nfor i in a[0:]:\n\t\tprint(i)', 'import collections\n\nN = int(input())\nl = [input() for _ in range(N)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\na = A[0:b + 1]\n', 'import collections\n\nN = int(input())\nl = [input() for _ in range(H)]\n\nc = collections.Counter(l)\n\nL = c.most_common()\n\nvalues, counts = zip(*c.most_common())\n\nA = list(values)\nB = list(counts)\n\nb = B.count(B[0])\n\na = A[0:b + 1]\n\n[print(i) for i in a]', 'import collections\n \nN = int(input())\nl = [input() for _ in range(N)]\n \nc = collections.Counter(l)\n \nL = c.most_common()\n \nvalues, counts = zip(*c.most_common())\n \nA = list(values)\nB = list(counts)\n \nb = B.count(B[0])\n \na = A[0:b]\nc = sorted(a)\n\nfor i in c[0:]:\n\t\tprint(i)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s040712110', 's051731044', 's148985072', 's212844274', 's216780764', 's349016327', 's418729081', 's523195463', 's625690338', 's753996093', 's766572111', 's789962196'] | [3060.0, 3060.0, 73576.0, 17412.0, 3060.0, 3060.0, 73584.0, 73708.0, 73576.0, 73580.0, 3316.0, 73584.0] | [17.0, 18.0, 720.0, 268.0, 18.0, 18.0, 585.0, 577.0, 721.0, 608.0, 22.0, 921.0] | [261, 253, 259, 83, 253, 253, 169, 213, 263, 228, 250, 272] |
p02773 | u370429695 | 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 s = input()\n if s in dic:\n dic[s] += 1\n else:\n dic[s] = 1\nmax_k_list = [kv[0] for kv in dic.items() if kv[1] == max(dic.values())]\nfor i in max_k_list:\n print(i)', "N = int(input(''))\ndict = {}\nfor i in range(N):\n S = input('')\n if S in dict:\n dict[S] += 1\n else:\n dict[S] = 1\nM = max(dict.values())\nout = [j for j in dict.keys() if dict[j] == M]\nout.sort()\nfor k in out:\n print(k)\n"] | ['Wrong Answer', 'Accepted'] | ['s078073649', 's889871293'] | [32096.0, 32092.0] | [2105.0, 828.0] | [217, 243] |
p02773 | u371132735 | 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 i in range(N):\n S.append(input())\ncnt = Counter(S).most_common()\nfor a,b in cnt:\n print(a*(b==cnt[0][1]))\n', 'from collections import Counter\nN = int(input())\nS = []\nfor i in range(N):\n S.append(input())\ncnt = Counter(S).most_common()\nans = []\nfor a,b in cnt:\n ans.append(a*(b==cnt[0][1]))\nans = sorted(ans)\nprint(ans)', 'from collections import Counter\nN = int(input())\nS = []\nfor i in range(N):\n S.append(input())\ncnt = Counter(S)\nans = []\nmax_vote = max(cnt.values())\nfor a,b in cnt.items():\n if max_vote==b:\n ans.append(a)\nans = sorted(ans)\nprint("\\r\\n".join(ans))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s675224027', 's930962918', 's788895438'] | [45040.0, 45040.0, 38164.0] | [551.0, 687.0, 527.0] | [169, 211, 253] |
p02773 | u371409687 | 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 i in range(n):\n tmp=input()\n if not tmp in a:\n a[tmp] = 1\n else:\n a[tmp] += 1\nans=sorted(a.items(), key=lambda x: -x[1])\nfor k, v in a.items():\n if v == max(a.values()):\n print(k)', 'n=int(input())\na={}\nfor i in range(n):\n tmp=input()\n if not tmp in a:\n a[tmp] = 1\n else:\n a[tmp] += 1\nM=max(a.values())\nans=[]\nfor k, v in a.items():\n if v == M:\n ans.append(k)\nans.sort()\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Accepted'] | ['s128514859', 's969262431'] | [43228.0, 32096.0] | [2106.0, 714.0] | [236, 264] |
p02773 | u372208514 | 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("in>"))\n\nall_str = []\nfor i in range(N):\n str_temp = input()\n all_str.append(str_temp)\n\nunique_str = list(set(all_str))\n\nmax_cnt = 0\nstr_num = dict()\nfor i in unique_str:\n cnt = all_str.count(i)\n str_num[i] = cnt\n if max_cnt < cnt:\n max_cnt = cnt\n\ndisp_list = []\nfor i in str_num:\n current_cnt = str_num[i]\n disp_list.append(i)\n\nfor i in disp_list:\n print(i)\n \n', '# -*- coding: utf-8 -*-\nN = int(input())\n\nall_str = []\nfor i in range(N):\n str_temp = input()\n all_str.append(str_temp)\n\nunique_str = list(set(all_str))\n\nmax_cnt = 0\nstr_num = dict()\nfor i in unique_str:\n cnt = all_str.count(i)\n str_num[i] = cnt\n if max_cnt < cnt:\n max_cnt = cnt\n\ndisp_list = []\nfor i in str_num:\n current_cnt = str_num[i]\n disp_list.append(i)\n\nfor i in disp_list:\n print(i)\n \n\n \n', '# -*- coding: utf-8 -*-\nimport collections\n\nN = int(input())\n\nall_str = []\nfor i in range(N):\n str_temp = input()\n all_str.append(str_temp)\nall_str.sort()\ncoll_str = (collections.Counter(all_str))\ncount_max = 0\nj = 0\nmax_str = coll_str.most_common()\nfor i in max_str:\n \n num_of_str = i[1]\n if num_of_str == count_max or j == 0:\n print(i[0])\n j = 1\n count_max = num_of_str\n \n if num_of_str < count_max:\n break\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s877335474', 's904472381', 's393657312'] | [35616.0, 35540.0, 49628.0] | [2206.0, 2206.0, 541.0] | [409, 434, 463] |
p02773 | u372550522 | 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 i in range(n):\n a = input()\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 0\n\nl = sorted(dic.items(), key=lambda x: x[1], reverse=True)\nnum = l[0][1]\nfor i in range(len(l)):\n if l[i][1] == num:\n print(l[i][0])\n else:\n break', 'n = int(input())\ndic = {}\nfor i in range(n):\n a = input()\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 0\n\nl = sorted(dic.items(), key=lambda x: x[1], reverse=True)\ni = 0\nwhile(i<n):\n print(l[i][0])\n if i<n-1:\n if l[i][1] != l[i+1][1]:\n break\n i += 1', 'n = int(input())\ndic = {}\nfor i in range(n):\n a = input()\n if a in dic:\n dic[a] += 1\n else:\n dic[a] = 0\n\nl = sorted(dic.items(), key=lambda x: x[1], reverse=True)\nnum = l[0][1]\nok = []\nfor i in range(len(l)):\n if l[i][1] == num:\n ok.append(l[i][0])\n else:\n break\nok.sort()\nfor i in ok:\n print(i)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s485497695', 's946432635', 's482915445'] | [44892.0, 44892.0, 45788.0] | [564.0, 622.0, 697.0] | [293, 298, 341] |
p02773 | u374829922 | 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())\nc = [0 for _ in range(n)]\nfor i in range(n):\n c[i] = input()\nc = collections.Counter(c).most_common()\n\nfirst = c[0][1]\nfor i in c:\n if i[1] == first:\n print(i[0])', 'import collections\nn = int(input())\nc = [0 for _ in range(n)]\nfor i in range(n):\n c[i] = input()\nc = collections.Counter(c).most_common()\nans = []\nfirst = c[0][1]\nfor i in c:\n if i[1] == first:\n ans.append(i[0])\n\nans.sort()\nfor l in ans:\n print(l)'] | ['Wrong Answer', 'Accepted'] | ['s682281367', 's076352048'] | [45028.0, 45028.0] | [547.0, 715.0] | [211, 263] |
p02773 | u376270730 | 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 contest(N, str):\n count = {}\n\n for s in str:\n if s not in count:\n count[s] = 1\n\n else:\n count[s] += 1\n \n ret = sorted(count.items(),key=lambda count: count[1], reverse=True)\n maxnum = ret[0][1]\n \n retVal = []\n\n for r in ret:\n if r[1] == maxnum:\n retVal.append(r[0])\n \n else:\n break\n\n result = \'\\n\'.join(sorted(retVal))\n\n return result\n\n\nif __name__ == "__main__":\n N = int(input())\n S = []\n\n for i in range(N):\n S.append(input())\n\n print(contest(N, str))\n', 'def contest(N, str):\n count = {}\n\n for s in str:\n if s not in count:\n count[s] = 1\n\n else:\n count[s] += 1\n \n ret = sorted(count.items(),key=lambda count: count[1], reverse=True)\n maxnum = ret[0][1]\n \n retVal = []\n\n for r in ret:\n if r[1] == maxnum:\n retVal.append(r[0])\n \n else:\n break\n\n result = \'\\n\'.join(sorted(retVal))\n\n return result\n\n\nif __name__ == "__main__":\n N = int(input())\n S = []\n\n for i in range(N):\n S.append(input())\n\n print(contest(N, S))\n'] | ['Runtime Error', 'Accepted'] | ['s287890940', 's348664215'] | [17056.0, 48072.0] | [297.0, 577.0] | [592, 590] |
p02773 | u378153116 | 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 poll(s_list):\n s_dict = {}\n for s in s_list:\n if s not in s_dict:\n s_dict[s] = 1\n else:\n s_dict[s] += 1\n\n max_val = max(s_dict.values())\n max_key = [key for key in s_dict if s_dict[key] == max_val]\n\n new_s_list = sorted(max_key)\n return new_s_list\n\ns_list = []\nn = int(input())\nfor i in range(n):\n s_list.append(input())\n\nnew_list = poll(s_list)\nprint(new_list)', 'def poll(s_list):\n s_dict = {}\n for s in s_list:\n if s not in s_dict:\n s_dict[s] = 1\n else:\n s_dict[s] += 1\n\n max_val = max(s_dict.values())\n max_key = [key for key in s_dict if s_dict[key] == max_val]\n\n new_s_list = sorted(max_key)\n return new_s_list\n\ns_list = []\nn = int(input())\nfor i in range(n):\n s_list.append(input())\n\nnew_list = poll(s_list)\n\nfor s in new_list:\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s328466020', 's942996514'] | [35220.0, 35220.0] | [536.0, 639.0] | [494, 509] |
p02773 | u382639013 | 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.append(str(input()))\n\nimport collections\n\ncounter = Counter(S)\n\nmax_cnt = max(counter.values())\n\nnames = [n for n,c in counter.items() if c==max_cnt]\nnames.sort()\nprint(*names, sep='\\n')", 'N = int(input())\nS = list()\nfor i in range(N):\n S.append(str(input()))\n \nimport collections\n \nc = collections.Counter(S)\nC = list(c.keys())\n \nfor i in range(0,len(C)):\n print(C[i])', 'N = int(input())\nS = list()\nfor i in range(N):\n S.append(str(input()))\n\nimport collections\n\nc = collections.Counter(S)\nC = list(c.keys())\n\nprint(list(c.keys()))\n\nfor i in range(0,len(C)):\n print(C[i])', "N = int(input())\nS = list()\nfor i in range(N):\n S.append(str(input()))\n\nimport collections\n\ncounter = collections.Counter(S)\n\nmax_cnt = max(counter.values())\n\nnames = [n for n,c in counter.items() if c==max_cnt]\nnames.sort()\nprint(*names, sep='\\n')"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s084614911', 's135328214', 's600123351', 's948170961'] | [17292.0, 35472.0, 41104.0, 35980.0] | [349.0, 551.0, 584.0, 684.0] | [239, 186, 206, 251] |
p02773 | u384198197 | 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. | ["dict={}\noutput=[]\n\niteration=read()\nif(iteration.isdigit()):\n iteration=int(iteration)\nelse:\n iteration=int(float(iteration))\nfor _ in range(iteration):\n item=read()\n \n if dict.get(item) is None:\n dict[item]=0 \n dict[item]+=1 \nmax_val=max(dict.values())\nwhile(bool(dict)):\n max_key=max(dict,key=dict.get)\n if(max_val!=dict[max_key]):\n break\n output.append(max_key)\n \n del dict[max_key]\noutput.sort()\nprint('\\n'.join(output))\n", "from sys import stdin\ndef read():\n return stdin.readline().strip()\n\ndict={}\noutput=[]\n\niteration=int(read())\n\nmax_val=-1\n\nfor _ in range(iteration):\n item=read()\n \n if dict.get(item) is None:\n dict[item]=0 \n dict[item]+=1 \n max_val = max(dict[item],max_val)\n#max_val=max(dict.values())\nfor k,v in dict.items():\n \n if(max_val==v):\n output.append(max_key)\n \n \noutput.sort()\nprint('\\n'.join(output))\n", "from sys import stdin\ndef read():\n return stdin.readline().strip()\n\ndict={}\noutput=[]\n\niteration=int(read())\n\nmax_val=-1\n\nfor _ in range(iteration):\n item=read()\n \n if dict.get(item) is None:\n dict[item]=0 \n dict[item]+=1 \n max_val = max(dict[item],max_val)\n#max_val=max(dict.values())\nfor k,v in dict:\n \n if(max_val==v):\n output.append(k)\n \n \noutput.sort()\nprint('\\n'.join(output))\n", "\nfrom sys import stdin\ndef read():\n return stdin.readline().strip()\n\ndict={}\noutput=[]\n\niteration=int(read())\n\nmax_val=-1\n\nfor _ in range(iteration):\n item=read()\n \n if dict.get(item) is None:\n dict[item]=0 \n dict[item]+=1 \n max_val = max(dict[item],max_val)\n#max_val=max(dict.values())\nfor k,v in dict.items():\n \n if(max_val==v):\n output.append(k)\n \n \noutput.sort()\nprint('\\n'.join(output))\n"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s024740268', 's181425614', 's184970918', 's118548540'] | [9128.0, 35412.0, 35332.0, 36676.0] | [28.0, 190.0, 194.0, 299.0] | [472, 441, 427, 436] |
p02773 | u384768892 | 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\nfrom collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\n\nc = Counter(S)\nd = c.most_common()\n\nt = 1\n\nfor i in range(1, len(d)):\n if d[0][1] == d[i][1]:\n t += 1\n else:\n pass\n\nfor i in range(t):\n print(d[i][0])', 'import numpy as np\nfrom collections import Counter\n \nN = int(input())\nS = [input() for _ in range(N)]\nc = Counter(S)\nd = c.most_common()\nt = 1\n\nfor i in range(1, len(d)):\n if d[0][1] == d[i][1]:\n t += 1\n else:\n pass\n\nL = [[]]*t\nfor j in range(t):\n L[j] = d[j][0]\n \nL = sorted(L)\nfor i in range(len(L)):\n print(L[i])'] | ['Wrong Answer', 'Accepted'] | ['s101157867', 's002514979'] | [55480.0, 57916.0] | [758.0, 1030.0] | [261, 326] |
p02773 | u384793271 | 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 x in range(N)]\n\nS_L = list(set(S))\n\n\n # if i not in S_L:\n # S_L.append(i)\n# print(S_L)\n\nS_N = [0] * len(S_L)\n\nfor j in S:\n ind = S_L.index(j)\n S_N[ind] += 1\n# print(S_N)\n\nS_max = [] \nS_N_max = max(S_N) \n\nfor k in range(len(S_N)):\n if S_N[k] == S_N_max:\n S_max.append(S_L[k])\n\nans_L = sorted(S_max)\n\nans = ''\ncnt = 0\nrng = len(ans_L)\nwhile cnt < rng:\n ans += ans_L[cnt]\n cnt += 1\n if cnt != rng:\n ans += ' '\nprint(ans)", "N = int(input())\nS = [input() for x in range(N)]\n\nS_L = []\n\nfor i in S:\n if i not in S_L:\n S_L.append(i)\n# print(S_L)\n\nS_N = [0] * len(S_L)\n\nfor j in S:\n ind = S_L.index(j)\n S_N[ind] += 1\n# print(S_N)\n\nS_max = [] \nS_N_max = max(S_N) \n\nfor k in range(len(S_N)):\n if S_N[k] == S_N_max:\n S_max.append(S_L[k])\n\nans_L = sorted(S_max)\nans = ''\ncnt = 0\nwhile cnt < len(ans_L):\n ans += ans_L[cnt]\n cnt += 1\n if cnt != len(ans_L):\n ans += ' '\nprint(ans)", "from collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\n\nS_cnt = Counter(S)\nmax_cnt = max(S_cnt.values())\n# print(max_cnt)\n\nnames = [name for name, v in S_cnt.items() if v == max_cnt]\nnames.sort()\n\nprint(*names, sep='\\n')\n"] | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s005496456', 's496889097', 's011515122'] | [29076.0, 17308.0, 35820.0] | [2104.0, 2104.0, 577.0] | [582, 562, 247] |
p02773 | u385309449 | 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. | ["l =[input() for i in range(n)]\nr=[]\nd={}\nfor i in l:\n if i in d:\n d[i]+=1\n else:\n d[i]=1\nm = max(d.values())\nfor key,value in d.items():\n if value==m:\n r.append(key)\nsorted_r = sorted(r)\nprint(*sorted_r,sep='\\n')", 'n = int(input())\ns = sorted([input() for _ in range(n)])\nans = [s[0]]\ncnt = 0\ncnt_list = [0]\nfor i in range(1,n):\n if s[i-1] == s[i]:\n cnt += 1\n if i == n-1:\n if max(cnt_list) == cnt:\n ans.append(s[i])\n elif max(cnt_list) < cnt:\n ans.clear()\n ans.append(s[i])\n else:\n if max(cnt_list) == cnt:\n ans.append(s[i])\n cnt = 0\n elif max(cnt_list) < cnt:\n ans.clear()\n ans.append(s[i])\n cnt_list[0] = cnt\n cnt = 0\nfor i in ans:\n print(i)', "n = int(input())\nl =[input() for i in range(n)]\nr=[]\nd={}\nfor i in l:\n if i in d:\n d[i]+=1\n else:\n d[i]=1\nm = max(d.values())\nfor key,value in d.items():\n if value==m:\n r.append(key)\nsorted_r = sorted(r)\nprint(*sorted_r,sep='\\n')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s355585277', 's480363856', 's922932423'] | [3064.0, 20136.0, 37132.0] | [17.0, 618.0, 605.0] | [242, 505, 259] |
p02773 | u386027192 | 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. | ['d={}\nk=0\nj=0\nfor i in range(int(input())):\n s=input()\n if d.get(s) is None:\n d[s]=1\n else:\n d[s]+=1\nfor i in sorted(d,key=d.get,reverse=True):\n print(i)\n k=d[i]\n break\nfor i in sorted(d,key=d.get,reverse=True):\n j+=1\n if j>1:\n if d[i]==k:\n print(i)\n', 'd={}\nk=0\nj=0\nl=[]\nfor i in range(int(input())):\n s=input()\n if d.get(s) is None:\n d[s]=1\n else:\n d[s]+=1\nfor i in sorted(d,key=d.get,reverse=True):\n l.append(i)\n k=d[i]\n break\nfor i in sorted(d,key=d.get,reverse=True):\n j+=1\n if j>1:\n if d[i]==k:\n l.append(i)\nl.sort()\nfor i in l:\n print(i)\n'] | ['Wrong Answer', 'Accepted'] | ['s421043556', 's471164172'] | [32216.0, 32220.0] | [713.0, 997.0] | [305, 350] |
p02773 | u387080888 | 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 _ in range(n):\n s.append(str(input()))\nans=collections.Counter(s)\nvalues,count=zip(*ans.items())\nfor l in range(len(count)):\n if max(count)==count[l]:\n print(values[l])', 'import collections\nn=int(input())\ns=[]\nfor _ in range(n):\n s.append(str(input()))\nans=collections.Counter(s)\na=max(ans.values())\nans=[i for i,k in ans.items() if a==k]\nprint(*ans.sort(),sep="\\n")', 'import collections\nn=int(input())\ns=[]\nfor _ in range(n):\n s.append(str(input()))\nans=collections.Counter(s)\nvalues,count=zip(*ans.most_common())\nfor l in range(len(count)):\n if max(count)==count[l]:\n print(values[l])', 'import collections\nn=int(input())\ns=[]\nfor _ in range(n):\n s.append(str(input()))\nans=collections.Counter(s)\nvalues,count=zip(*ans)\nfor l in range(len(count)):\n if max(count)==count[l]:\n print(values[l])', 'import collections\nn=int(input())\ns=[]\nfor _ in range(n):\n s.append(str(input()))\nans=collections.Counter(s)\na=max(ans.values())\nans=[i for i,k in ans.items() if a==k]\nprint(*sorted(ans),sep="\\n")'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s074899619', 's217247657', 's477065880', 's758864854', 's236737505'] | [59328.0, 35564.0, 59508.0, 46576.0, 35564.0] | [2105.0, 546.0, 2105.0, 530.0, 656.0] | [224, 198, 230, 216, 199] |
p02773 | u392058721 | 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 = [str(input()) for _ in range(n)]\nd = dict((l,s.count(l)) for l in set(s))\nmax = 0\nfor x, y in d.items():\n if y > max:\n max = y\nfor x, y in d.items():\n if y == max:\n print(x)', 'n = int(input())\nd = {}\nfor i in range(n):\n s = str(input())\n if s in d.keys():\n d[s] += 1\n else:\n d[s] = 1\nmax = max(d.values())\nk = [x for x, y in d.items() if y ==max]\nk.sort()\nfor i in k:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s113500358', 's203630455'] | [29076.0, 32096.0] | [2105.0, 696.0] | [214, 227] |
p02773 | u394352233 | 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 = [input() for i in range(N)]\nimport collections\nc = collections.Counter(A)\nprint(c.most_common()[0][0])', 'N = int(input())\nA = [input() for i in range(N)]\nimport collections\nc = collections.Counter(A)\n#print(c)\nmax = c.most_common()[0][1]\n#print(max)\n#print(c.most_common()[0][0])\nli = list(c)\n#print(li)\nkeys = [k for k, v in c.items() if v == max]\n#print(keys)\nkeys.sort()\nfor i in keys:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s287538508', 's927007692'] | [46348.0, 45072.0] | [398.0, 695.0] | [123, 296] |
p02773 | u394731058 | 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 as c\n\nn = int(input())\nl = [input() for _ in range(n)]\nc = c.Counter(l)\nc = c.most_common()\nfor i in c:\n if i[1] == c[0][1]: \n print(i[0])', 'import collections as c\n\nn = int(input())\nl = [input() for _ in range(n)]\nc = c.Counter(l)\nc = c.most_common()\nans = []\nfor i in c:\n if i[1] == c[0][1]: \n ans.append(i[0])\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s114692200', 's790975541'] | [45040.0, 45040.0] | [572.0, 729.0] | [161, 211] |
p02773 | u394950523 | 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 = []\nfor i in range(N):\n S.append(input())\n\nS.sort() \ncounted = Counter(S)\nl = counted.most_common()\nm = l[0][1]\nl.sort()\nfor i in l:\n if m == i[1]:\n print(i[0])\n else:\n break', 'from collections import Counter\n\nN = int(input())\nS = []\nfor i in range(N):\n S.append(input())\n\nS.sort() \ncounted = Counter(S)\nl = counted.most_common()\nm = l[0][1]\nl.sort()\nfor i in l:\n if m == i[1]:\n print(i[0])'] | ['Wrong Answer', 'Accepted'] | ['s834695890', 's583342552'] | [46840.0, 46900.0] | [1004.0, 979.0] | [327, 303] |
p02773 | u395202850 | 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 sys\nimport collections\nimport bisect\nreadline = sys.stdin.readline\n\n\ndef main():\n n = int(readline().rstrip())\n S = [readline().rstrip() for _ in range(n)]\n c = collections.Counter(S)\n maxS = c.most_common()[0][1]\n for i in range(len(c)):\n if c.most_common()[i][1] == maxS:\n print(c.most_common()[i][0])\n\n\nif __name__ == '__main__':\n main()\n", "import math\nimport sys\nimport collections\nimport bisect\nreadline = sys.stdin.readline\n\n\ndef main():\n n = int(readline().rstrip())\n S = [readline().rstrip() for _ in range(n)]\n c = collections.Counter(S)\n keys = sorted(c.keys())\n maxS = c.most_common()[0][1]\n for key in keys:\n if c[key] == maxS:\n print(key)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s100809205', 's196266728'] | [49636.0, 51064.0] | [2207.0, 311.0] | [396, 384] |
p02773 | u398175819 | 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\ncdic = {}\nfor i in range(N):\n si = input()\n if si not in cdic.keys():\n cdic[si] = 1\n else:\n cdic[si] += 1\n \nspair = sorted(cdic.items(), key=lambda x:x[1], reverse=True)\nvmax = -1\nmaxes = []\nfor pair in spair:\n if pair[1] >= vmax:\n maxes.append(pair[0])\n else:\n break\n \nsmaxes = sorted(maxes)\nfor s in smaxes:\n print(s)\n', "N = int(input())\n\ncdic = {}\nfor i in range(N):\n si = input()\n if si not in cdic.keys():\n cdic[si] = 1\n else:\n cdic[si] += 1\n \nspair = sorted(cdic.items(), key=lambda x:x[1], reverse=True)\n\n\n# print(cdic)\n\n\n\nvmax = -1\nmaxes = []\nfor pair in spair:\n if pair[1] >= vmax:\n maxes.append(pair[0])\n vmax = pair[1]\n else:\n break\n \n# print(maxes)\nsmaxes = sorted(maxes)\n# print(smaxes)\n# print('---')\n\nfor s in smaxes:\n print(s)\n"] | ['Wrong Answer', 'Accepted'] | ['s814862378', 's680818557'] | [47324.0, 47324.0] | [758.0, 762.0] | [398, 501] |
p02773 | u403331159 | 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()\ncnt=1\nans=0\npri=[]\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n ans=max(cnt,ans)\n cnt=1\nans=max(cnt,ans)\nfor i in range(n):\n if ans==s.count(s[i]):\n pri.append(s[i])\nprint(ans)\nt=set(pri)\np=list(t)\np.sort()\nfor i in range(len(p)):\n print(p[i])', 'n=int(input())\ns=[input() for i in range(n)]\ns.sort()\ncnt=1\nans=0\npri=[]\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n ans=max(cnt,ans)\n cnt=1\nans=max(cnt,ans)\ncnt=1\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n if cnt==ans:\n pri.append(s[i])\n cnt=1\n else:\n cnt=1\nif cnt==ans:\n pri.append(s[-1])\nprint(ans)\nfor i in range(len(pri)):\n print(pri[i])', 'n=int(input())\ns=[input() for i in range(n)]\ns.sort()\ncnt=1\nans=0\npri=[]\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n ans=max(cnt,ans)\n cnt=1\nans=max(cnt,ans)\nfor i in range(n):\n if ans==s.count(s[i]):\n pri.append(s[i])\nprint(ans)\nt=set(pri)\np=list(t)\np.sort()\nprint(p)', 'n=int(input())\ns=[input() for i in range(n)]\ns.sort()\ncnt=1\nans=0\npri=[]\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n ans=max(cnt,ans)\n cnt=1\nans=max(cnt,ans)\ncnt=1\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n if cnt==ans:\n pri.append(s[i])\n cnt=1\n else:\n cnt=1\nif cnt==ans:\n pri.append(s[-1])\nfor i in range(len(pri)):\n print(pri[i])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s108901394', 's385632811', 's938014487', 's520132177'] | [17796.0, 20680.0, 17796.0, 20676.0] | [2104.0, 702.0, 2108.0, 705.0] | [347, 458, 316, 447] |
p02773 | u405256066 | 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 sys import stdin\nN = int(stdin.readline().rstrip())\ndata = []\nfor i in range(N):\n s = (stdin.readline().rstrip())\n data.append(s)\nc = collections.Counter(data)\nmaxc = max(c.values())\nfor j in c.keys():\n if c[j] == maxc:\n print(j)', 'import collections\nfrom sys import stdin\nN = int(stdin.readline().rstrip())\ndata = []\nfor i in range(N):\n s = (stdin.readline().rstrip())\n data.append(s)\nc = collections.Counter(data)\nmaxc = max(c.values())\nfor j in sorted(c.keys()):\n if c[j] == maxc:\n print(j)'] | ['Wrong Answer', 'Accepted'] | ['s025256774', 's063679057'] | [35560.0, 35564.0] | [318.0, 487.0] | [269, 277] |
p02773 | u406405116 | 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 inverse_lookup(d, x):\n a = []\n for k,v in d.items():\n if x == v:\n a.append(k)\n print(type(a))\n return sorted(a)\n\nn = int(input())\nw = {}\nfor _ in range(n):\n i = input()\n if i in w:\n w[i] += 1\n else:\n w[i] = 1\nm = max(w.values())\nfor j in inverse_lookup(w,m):\n print(j)', 'def inverse_lookup(d, x):\n a = []\n for k,v in d.items():\n if x == v:\n a.append(k)\n return a\n\nn = int(input())\nw = {}\nfor i in range(n):\n if i in w:\n w[i] += 1\n else:\n w[i] = 1\nm = max(w.values())\nfor i in inverse_lookup(w,m).sort(reverse=True):\n print(i)', 'def inverse_lookup(d, x):\n a = []\n for k,v in d.items():\n if x == v:\n a.append(k)\n return sorted(a)\n\nn = int(input())\nw = {}\nfor _ in range(n):\n i = input()\n if i in w:\n w[i] += 1\n else:\n w[i] = 1\nm = max(w.values())\nfor j in inverse_lookup(w,m):\n print(j)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s147823634', 's540085358', 's760806229'] | [32988.0, 27112.0, 32988.0] | [699.0, 89.0, 628.0] | [310, 288, 291] |
p02773 | u406984840 | 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 = []\nkaisuu = []\nsolution = []\nindex = 0\n\nfor i in range(N):\n tmp = input()\n S.append(tmp)\n \nc = collections.Counter(S)\n\nd = c.most_common()\n\nmax_ = d[0][1]\n\nfor i in range(len(d)):\n if d[i][1] == max_:\n solution.append(d[i][0])\n\nfor i in solution:\n print(i)', 'import collections\n\nN = int(input())\nS = []\nkaisuu = []\nsolution = []\nindex = 0\n\nfor i in range(N):\n tmp = input()\n S.append(tmp)\n \nc = collections.Counter(S)\n\nd = c.most_common()\n\nmax_ = d[0][1]\n\nfor i in range(len(d)):\n if d[i][1] == max_:\n solution.append(d[i][0])\n\nfor i in solution:\n print(i)', 'import math\n\nN = int(input())\nS = []\nkaisuu = []\nsolution = []\nindex = 0\n\nfor i in range(N):\n tmp = input()\n \n if (tmp in S) == False:\n S.append(tmp)\n kaisuu.append(1)\n index += 1\n \n if (tmp in S) == True:\n index_tmp = S.index(tmp)\n kaisuu[index_tmp] += 1\n \nmax_ = max(kaisuu)\n\nfor i in range(N):\n if kaisuu[i] == max_:\n solution.append(S[i])\n \nsolution.sort()\n\nfor i in solution:\n print(i)', 'import collections\n\nN = int(input())\nsolution = []\nS = []\n\nfor i in range(N):\n tmp = input()\n S.append(tmp)\n \nc = collections.Counter(S)\n\nd = c.most_common()\n\nmax_ = d[0][1]\n\nfor i,k in enumerate(d):\n if d[i][1] == max_:\n solution.append(d[i][0])\n \nsolution.sort()\n\nfor i in solution:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s644761785', 's705964679', 's889356836', 's660809528'] | [47068.0, 47048.0, 3956.0, 47664.0] | [644.0, 632.0, 2104.0, 768.0] | [305, 305, 419, 305] |
p02773 | u411237324 | 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\ndic = defaultdict(int)\n\nn = int(input())\nA = [input() for i in range(n)]\n# A = list(map(str, A))\n# print(A)\n\nvote = 0\n\nfor elem in A:\n dic[elem] += 1\n# print(dic)\nm = max(dic.values())\n# print(m)\n\nfor key in dic:\n # print(dic[key])\n if dic[key] == m:\n print(key)\n', 'from collections import defaultdict\ndic = defaultdict(int)\n\nn = int(input())\nA = [input() for i in range(n)]\nfor elem in A:\n dic[elem] += 1\n# print(dic)\nm = max(dic.values())\n# print(m)\n\nAns = []\nfor key in dic:\n # print(dic[key])\n if dic[key] == m:\n Ans.append(key)\n\nAns = sorted(Ans)\nprint([i for i in Ans])\n', 'from collections import defaultdict\ndic = defaultdict(int)\n\nn = int(input())\nA = [input() for i in range(n)]\nfor elem in A:\n dic[elem] += 1\n# print(dic)\nm = max(dic.values())\n# print(m)\n\nAns = []\nfor key in dic:\n # print(dic[key])\n if dic[key] == m:\n Ans.append(key)\n\nAns = sorted(Ans)\nfor i in Ans:\n print(i)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s681759669', 's929207105', 's587812081'] | [35572.0, 39280.0, 35572.0] | [491.0, 610.0, 690.0] | [315, 326, 329] |
p02773 | u411858517 | 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 = [input() for _ in range(N)]\n\nword = {}\nfor i in range(N):\n if L[i] in word:\n word[L[i]] += 1\n else:\n word[L[i]] = 1\n\nmax_count = 0\nfor i in range(N):\n max_count = max(max_count, word[L[i]])\n \nans = []\nfor i in range(N):\n if word[L[i]] == max_count:\n ans.append(L[i])\n \nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])', 'N = int(input())\nL = [input() for _ in range(N)]\n\nword = {}\nfor i in range(N):\n if L[i] in word:\n word[L[i]] += 1\n else:\n word[L[i]] = 1\n\nmax_count = 0\nfor i in range(N):\n max_count = max(max_count, word[L[i]])\n \nans = []\nfor i in range(N):\n if word[L[i]] == max_count:\n ans.append(L[i])\n \nans = list(set(ans))\nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Accepted'] | ['s978086614', 's525458020'] | [35216.0, 45456.0] | [796.0, 840.0] | [388, 403] |
p02773 | u413165887 | 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 = [str(input()) for i in range(n)]\n\nfrom collections import Counter\nc = Counter(s)\n\nresult = [i for i in c.items() if i[1]==max(c.values())]\n\nfor i in range(len(result)):\n print(result[i][0])', 'n = int(input())\n \ns = [str(input()) for i in range(n)]\n \nfrom collections import Counter\nc = Counter(s)\n\nmax_num = max(c.values())\n\nresult = [i[0] for i in c.items() if i[1]==max_num]\nresult.sort()\n \nfor i in range(len(result)):\n print(result[i])'] | ['Wrong Answer', 'Accepted'] | ['s640832356', 's313429301'] | [35476.0, 35476.0] | [2105.0, 677.0] | [214, 250] |
p02773 | u414376763 | 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 = []\ns_uniq = []\nmax_count = 0\nmax_s = []\n\nfor i in range(n):\n s_n = str(input())\n s.append(s_n)\n if s_n not in s_uniq:\n s_uniq.append(s_n)\n\nfor i in s_uniq:\n if s.count(i) > max_count:\n max_count = s.count(i)\n max_s = []\n max_s.append(i)\n elif s.count(i) == max_count:\n max_s.append(i)\n\nfor i in max_s:\n print(i)', 'n = int(input())\nd = {}\n\nfor i in range(n):\n s = str(input())\n if s in d.keys():\n d[s] += 1\n else:\n d[s] = 1\n\nmax_count = max(d.values())\n\nfor i in sorted(d.keys()):\n if d[i] == max_count:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s545743352', 's442139151'] | [23200.0, 35280.0] | [2206.0, 510.0] | [353, 211] |
p02773 | u414615201 | 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. | ['# input\nN = int( input() )\nS = list()\nfor ii in range(N):\n S.append( input() )\nS.sort()\n\n# calc \nimport collections\nC = collections.Counter( S )\n\n# output \nfor key in C.most_common():\n print(key[0])', "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# input\nN = int( input() )\nS = list()\nfor ii in range(N):\n S.append( input() )\n\n# calc \nfrom collections import Counter\n \nC = Counter( S )\nmax_cnt = max(C.values())\n\nwords = list()\nfor word, cnt in C.items():\n if cnt == max_cnt:\n words.append(word)\nwords.sort()\n\nprint(*words, sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s525954274', 's909211254'] | [46864.0, 35852.0] | [742.0, 642.0] | [213, 353] |
p02773 | u414980766 | 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\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nN = int(readline())\nS = read().split()\n\nS = sorted(S)\nls = [[] for i in range(N + 1)]\nmax_num = 0\nleft = 0\nright = 0\nwhile right < N:\n while right < N and S[left] == S[right]:\n right += 1\n if (right - left) >= max_num:\n ls[right - left].append(S[left])\n max_num = right - left\n left = right\n \nprint('\\n'.join(ls[max_num]))", 'n = input()\ns = [input() for i in range(n)]\nu = set(s)\ndic = dict(zip(u, [0]*len(u)))\nfor i in range(n):\n dic[s[i]] += 1\nm = max(dic.values())\nres = []\nfor k, v in dic.items():\n if v == m:\n res.appned(k)\nres.sort()\nprint(*res, sep="\\n")', 'n = int(input())\ns = [input() for i in range(n)]\nu = set(s)\ndic = dict(zip(u, [0]*len(u)))\nfor i in range(n):\n dic[s[i]] += 1\nm = max(dic.values())\nres = []\nfor k, v in dic.items():\n if v == m:\n res.append(k)\nres.sort()\nprint(*res, sep="\\n")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s260081428', 's816471602', 's010698423'] | [30564.0, 3064.0, 50960.0] | [422.0, 17.0, 684.0] | [472, 249, 254] |
p02773 | u422272120 | 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 not s in d:\n d[s] = 1\n else:\n d[s] += 1\nd_max = max(d.values())\nans = [k for k, v in d.items() if v == d_max]\nfor a in ans:\n print (a)', '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\nd_max = max(d.values())\nans = [k for k, v in d.items() if v == d_max]\nfor a in sorted(ans):\n print (a)'] | ['Wrong Answer', 'Accepted'] | ['s478488503', 's964872307'] | [32096.0, 32988.0] | [470.0, 637.0] | [220, 224] |
p02773 | u423966555 | 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\nn = int(input())\n\nd = defaultdict(int)\nfor _ in range(n):\n key = input()\n d[key] += 1\n\ndict = sorted(d.items(), key=lambda x:x[1], reverse=True)\nmax_v = max(d.values())\n\ndict_li = []\nfor a in dict:\n if a[1]==max_v:\n dict_li.append(a[0])\n else:\n exit()\n\ndict_li.sort()\nfor s in dict_li:\n print(s)\n', "from collections import Counter\nn = int(input())\ns = [input() for _ in range(n)]\ncnt = Counter(s)\nmax_v = max(cnt.values())\nans = [s for s,c in cnt.items() if c==max_v]\nans.sort()\nprint('\\n'.join(ans))"] | ['Wrong Answer', 'Accepted'] | ['s289354827', 's573851737'] | [46084.0, 35952.0] | [816.0, 522.0] | [361, 201] |
p02773 | u424467986 | 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())\n\nS = []\nfor i in range(N):\n S.append(input())\n\nans = {}\nfor cnt in S:\n if cnt in ans:\n ans[cnt] += 1\n else:\n \tans[cnt] = 1\n\nmax_v = max(ans.values())\nfor k, v in ans.items():\n if v == max_v:\n print(k)', '\nN = int(input())\n\nS = []\nfor i in range(N):\n S.append(input())\n\nans = {}\nfor cnt in S:\n if cnt in ans:\n ans[cnt] += 1\n else:\n \tans[cnt] = 1\nmax_v = max(ans.values())\n\nfor k, v in sorted(ans.items()):\n if v == max_v:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s106421085', 's137845527'] | [35216.0, 45708.0] | [460.0, 835.0] | [355, 454] |
p02773 | u425184437 | 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())\nq={}\nfor i in range(N):\n S=input()\n if S in q:\n q[S]+=1\n else:\n q[S]=1\nmax_q_list = [kv[0] for kv in q.items() if kv[1] == max(q.values())] \nfor i in max_q_list:\n print(i)', 'N=int(input())\nfrom collections import Counter\nA=[]\nfor i in range(N):\n s=input()\n A.append(s)\na=Counter(A).most_common()\nb=a[0][1]\nans=[]\nfor i in range(len(a)):\n if a[i][1]==b:\n ans.append(a[i][0])\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s879540398', 's658978121'] | [32096.0, 45044.0] | [2104.0, 701.0] | [199, 241] |
p02773 | u425762225 | 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 = [input() for _ in range(N)]\nm = set(l)\nd = dict()\n\nfor name in m:\n d[name] = l.count(name)\n \n \nmax_kv_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]\nfor name in max_kv_list:\n print(name)', "#!/usr/bin/env python3\nfrom collections import Counter\n\ndef solve(l):\n d = Counter(l)\n d_max = max(d.values())\n max_d_list = sorted([k[0] for k in d.items() if k[1] == d_max])\n return max_d_list\n\n\n\ndef main():\n N = int(input())\n l = [input() for _ in range(N)]\n d = solve(l)\n for a in d:\n print(a)\n return\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s674729252', 's433093985'] | [29076.0, 38728.0] | [2105.0, 431.0] | [227, 379] |
p02773 | u428199834 | 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())\nimport collections\nd=collections.Counter(s)\nlargest=max(list(d.values()))\nans=[]\nfor key in d.keys():\n if d[key]==largest:\n ans.append(key)\nans.sort()\nwhile len(ans)>0:\n print(ans.popleft(-1))\n \n \n', 'n=int(input())\ns=[]\nfor _ in range(n):\n s.append(input())\nimport collections \nd=collections.Counter(s)\nlarger=max(list(d.values()))\nans=[]\nfor key in d.keys():\n if d[key]==larger:\n ans.append(key)\nans.sort()\nfor _ in range(len(ans)):\n print(ans[_])\n '] | ['Runtime Error', 'Accepted'] | ['s857148781', 's999261641'] | [38924.0, 38848.0] | [394.0, 458.0] | [263, 259] |
p02773 | u428747123 | 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 as col\n\n\nn=int(input())\ns=[input() for i in range(n)]\nc = col.Counter(s)\nmax = max(c.values())\nans = []\n\nfor key,val in c.items():\n if val == max:\n ans.append(key)\n\n\nfor i in ans:\n print(i)\n\n \n\n', 'import collections as col\n\n\nn=int(input())\ns=[input() for i in range(n)]\nc = col.Counter(s)\nmax = max(c.values())\nans = []\n\nfor key,val in c.items():\n if val == max:\n ans.append(key)\n\nans.sort()\n\nfor i in ans:\n print(i)\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s475878143', 's892128618'] | [35572.0, 35572.0] | [504.0, 630.0] | [228, 235] |
p02773 | u430928274 | 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\n\nmx = max(d.values())\nfor s in sorted(k for k in d if d[k] == m) :\n print(s)\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\n\nmx = max(d.values())\nfor s in sorted(k for k in d if d[k] == mx) :\n print(s)\n'] | ['Runtime Error', 'Accepted'] | ['s490552412', 's133525741'] | [35296.0, 35424.0] | [289.0, 439.0] | [202, 203] |
p02773 | u432098488 | 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\nd = {}\nfor s in S:\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n \nans = 0\nfor i in d:\n if ans < d[i]:\n ans = d[i]\n\nfor i in d:\n if ans == d[i]:\n print(i)', 'n = int(input())\nS = []\nfor _ in range(n):\n S.append(input())\n\nd = {}\nfor s in S:\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nans = 0\nfor i in d.values():\n if ans < i:\n ans = i\n\nfor k, v in d.items():\n if ans == v:\n print(k)', 'n = int(input())\nS = []\nfor _ in range(n):\n S.append(input())\n\nd = {}\nfor s in S:\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nans = 0\nfor i in d.values():\n if ans < i:\n ans = i\n\nsor = sorted(d.keys())\nfor k, v in sor.items():\n if ans == v:\n print(k)', 'N = int(input())\ndic = {}\n\nfor i in range(N):\n S = input()\n if S in dic:\n dic[S] += 1\n else:\n dic[S] = 1\n \nmax_N = max(list(dic.values()))\nkeys = sorted([k for k, v in dic.items() if v == max_N])\n\nfor i in range(len(keys)):\n print(keys[i])'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s366933247', 's530799036', 's715845642', 's325144177'] | [35216.0, 35220.0, 35220.0, 32988.0] | [477.0, 467.0, 525.0, 694.0] | [233, 240, 265, 252] |
p02773 | u435076592 | 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 sys import stdin, stdout\nfrom collections import defaultdict\nn = int(stdin.readline().strip())\nword_map = defaultdict(lambda: 0)\nmaxi = 0\nfor i in range(n):\n word = stding.readline().strip()\n x = word_map[word]\n word_map[word] = x + 1\n maxi = max(maxi, x+1)\n \nword_list = []\nfor key, value in word_map.items():\n if value == maxi:\n word_list.append(key)\nword_list.sort()\nfor word in word_list:\n stdout.write(word+'\\n')\n ", "from sys import stdin, stdout\nfrom collections import defaultdict\nn = int(stdin.readline().strip())\nword_map = defaultdict(lambda: 0)\nmaxi = 0\nfor i in range(n):\n word = stdin.readline().strip()\n x = word_map[word]\n word_map[word] = x + 1\n maxi = max(maxi, x+1)\n \nword_list = []\nfor key, value in word_map.items():\n if value == maxi:\n word_list.append(key)\nword_list.sort()\nfor word in word_list:\n stdout.write(word+'\\n')"] | ['Runtime Error', 'Accepted'] | ['s022319104', 's574604280'] | [3316.0, 32452.0] | [20.0, 550.0] | [435, 431] |
p02773 | u435108403 | 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()\n\nfor _ in range(N):\n S.append(input())\nS_set = set(S)\nS_dict = dict()\nfor s in S_set:\n S_dict[s] = 0\n\nfor val in S:\n S_dict[val] += 1\nmax_num = max(S_dict.values())\nans = list()\nfor k, v in S_dict.items():\n if v == max_num:\n ans.append(k)\nsorted(ans)\nfor res in ans:\n for _ in range(max_num):\n print(res)\n', 'N = int(input())\nS = list()\n\nfor _ in range(N):\n S.append(input())\nS_set = set(S)\nS_dict = dict()\nfor s in S_set:\n S_dict[s] = 0\n\nfor val in S:\n S_dict[val] += 1\nmax_num = max(S_dict.values())\nans = list()\nfor k, v in S_dict.items():\n if v == max_num:\n ans.append(k)\nans = sorted(ans)\nfor res in ans:\n print(res)\n '] | ['Wrong Answer', 'Accepted'] | ['s762851604', 's611726048'] | [49420.0, 49424.0] | [785.0, 729.0] | [362, 339] |
p02773 | u436664080 | 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 sys import stdin\n\nn = int(stdin.readline().rstrip())\ns = []\nd = [0] * 200000 \nmax = 1\n\nfor i in range(n):\n t = stdin.readline().rstrip()\n d[i] = 1\n for ss in s:\n if t == ss:\n d[i] = d[i] + 1\n if max < d[i]:\n max = d[i]\n s.append(t)\n\nresult = [] \nfor cnt in range(len(d)):\n if d[cnt] == max:\n result.append(s[cnt])\n\nprint(sorted(result))', 'from sys import stdin\nimport math\n\nn = int(stdin.readline().rstrip())\n\nd = {}\nmax = 0\nfor i in range(n):\n s = stdin.readline().rstrip()\n if s in d.keys():\n d[s] += 1\n else:\n d[s] = 1\n if max < d[s]:\n max = d[s]\n\nresult = []\nfor key, value in d.items():\n if value == max:\n result.append(key)\n\nresult.sort()\n\nfor i in range(len(result)):\n print(result[i])'] | ['Wrong Answer', 'Accepted'] | ['s739211936', 's480379479'] | [5216.0, 32092.0] | [2104.0, 544.0] | [414, 399] |
p02773 | u437215432 | 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\ndef f(n, a):\n index, count = np.unique(a, return_counts=True)\n mx = max(count)\n for s in index[count == mx]:\n print(s)\n print(mx)\n\nn = int(input())\na = [0] * n\nfor i in range(n):\n a[i] = input()\nf(n, a)\n', 'import numpy as np\ndef f(n, a):\n index, count = np.unique(a, return_counts=True)\n mx = max(count)\n for s in index[count == mx]:\n print(s)\n print(mx)\n\nn = int(input())\na = [0] * n\nfor i in range(n):\n a[i] = input()\nf(n, a)\n', '# ABC155C ref. ABC008B\n\nd = {}\nmax_value = 1\nn = int(input())\nfor i in range(n):\n t = input()\n if t in d.keys():\n d[t] += 1\n if d[t] > max_value:\n max_value = d[t]\n else:\n d.setdefault(t, 1)\n#print(f"d = {d}")\n#print(f"max_value = {max_value}")\n#print(f"d.keys() = {d.keys()}")\n#print(f"d.values() = {d.values()}")\nd = sorted(d.items())\n#print(d)\nfor k, v in d:\n if v == max_value:\n print(k)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s160845717', 's464003250', 's097638917'] | [25920.0, 26692.0, 46884.0] | [405.0, 404.0, 625.0] | [244, 244, 443] |
p02773 | u437723389 | 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 = input()\nwords_org = []\nfor i in range(int(n)):\n words_org.append(input())\nprint(words_org)\n\ncountDic = { k: words_org.count(k) for k in set(words_org) }\nranking = sorted([item for item in countDic.items()], key = lambda x:x[1], reverse=True)\norder = 0\ntop = ranking[0][1]\ncandidates = []\nwhile ranking[order][1] == top:\n candidates.append(ranking[order][0])\n order += 1\n if order > len(ranking)-1:\n break\nfor word in sorted(candidates):\n print(word)', 'n = input()\nwords_org = []\nfor i in range(n):\n words_org.append(input())\ncountDic = { k: words_org.count(k) for k in set(words_org) }\nranking = sorted([item for item in countDic.items()], key = lambda x:x[1])\norder = 0\ntop = ranking[0][1]\ncandidates = []\nwhile ranking[order][1] == top:\n candidates.append(ranking[order][0])\n order += 1\nfor word in sorted(candidates):\n print(word)', "N = input()\ndic = {}\nmax = 0\nfor i in range(int(N)):\n word = input()\n if word not in dic.keys():\n \n if max == 0:\n max += 1\n dic['word'] = 1\n \n else:\n \n if max == dic['word']:\n max += 1\n dic['word'] += 1\n \ncandidates = sorted([word for word in dic.keys() if dic[key] == max])\nfor word in candidates:\n print(word)", 'n = input()\nwords_org = []\nfor i in range(int(n)):\n words_org.append(input())\nprint(words_org)\n\ncountDic = { k: words_org.count(k) for k in set(words_org) }\nranking = sorted([item for item in countDic.items()], key = lambda x:x[1], reverse=True)\norder = 0\ntop = ranking[0][1]\ncandidates = []\nwhile ranking[order][1] == top:\n candidates.append(ranking[order][0])\n order += 1\nfor word in sorted(candidates):\n print(word)', 'N = input()\ndic = {}\nmax = 0\nfor i in range(int(N)):\n word = input()\n if word not in dic.keys():\n \n if max == 0:\n max += 1\n dic[word] = 1\n \n else:\n \n if max == dic[word]:\n max += 1\n dic[word] += 1\n\ncandidates = sorted([word for word in dic.keys() if dic[word] == max])\nfor word in candidates:\n print(word)\n'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s099207350', 's398385444', 's745007921', 's864471221', 's191972855'] | [33940.0, 3064.0, 3064.0, 33940.0, 32988.0] | [2105.0, 17.0, 317.0, 2105.0, 680.0] | [461, 385, 349, 422, 341] |
p02773 | u439212411 | 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\ndef inverse_lookup(d, x):\n cList = []\n for k,v in d.items():\n if x == v:\n l = k\n cList.append(l) \n return cList\n\nn = int(input())\nList=[input() for i in range(n)]\nc = collections.Counter(List)\nprint(c)\nn = max(c.values())\nout=sorted(inverse_lookup(c,n))\nfor word in out:\n print(word)\n\n\n', 'import collections\ndef inverse_lookup(d, x):\n cList = []\n for k,v in d.items():\n if x == v:\n l = k\n cList.append(l) \n return cList\n\nn = int(input())\nList=[input() for i in range(n)]\nc = collections.Counter(List)\n\nn = max(c.values())\nout=sorted(inverse_lookup(c,n))\nfor word in out:\n print(word)\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s114430897', 's252812603'] | [58696.0, 35572.0] | [814.0, 643.0] | [346, 338] |
p02773 | u440129511 | 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)]\nc=collections.Counter(s)\nl=c.most_common()\nk=l[0][1]\nfor i in range(n):\n if l[i][1]==k:print(l[i][0])\n else:exit()', 'import collections\nn=int(input())\ns=[input() for _ in range(n)]\nc=collections.Counter(s)\nl=c.most_common()\nk=l[0][1]\nl1=[]\nfor i in range(len(l)):\n if l[i][1]==k:l1.append(l[i][0])\n else:break\nl1.sort()\nfor i in range(len(l1)):\n print(l1[i])'] | ['Runtime Error', 'Accepted'] | ['s714848558', 's095174600'] | [46880.0, 47636.0] | [575.0, 773.0] | [184, 250] |
p02773 | u440161695 | 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 OrderedDict\nN=int(input())\nd=dict()\nma=0\nfor i in range(N):\n s=input()\n if s not in d:\n d[s]=0\n d[s]+=1\nd=OrderedDict(sorted(d.items(), key=lambda x:x[1], reverse=True))\nfor i in d:\n if ma<=i:\n ma=i\n if ma!=i:\n exit()\n print(d[i])', 'N=int(input())\nd=dict()\nA=[]\nma=0\nfor i in range(N):\n s=input()\n if s not in d:\n d[s]=0\n d[s]+=1\nma=max(d.values())\nfor i in d:\n if d[i]==ma:\n print(i)', 'N=int(input())\nd=dict()\nA=[]\nma=0\nfor i in range(N):\n s=input()\n if s not in d:\n d[s]=0\n d[s]+=1\nma=max(d.values())\nfor i,j in sorted(d.items()):\n if j==ma:\n print(i)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s680276065', 's732954736', 's905563775'] | [107092.0, 32096.0, 44124.0] | [1067.0, 510.0, 930.0] | [269, 161, 177] |
p02773 | u441254033 | 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. | ['\nimport collections\n\nn = int(input())\n\nss = []\nfor _ in range(n):\n ss.append(input())\n\nc = collections.Counter(ss)\n\nl = c.most_common()\n\nprint(l[0][1])\nfor i in range(len(l)-1):\n if l[i][1] == l[i+1]:\n print(l[i+1])\n else:\n break\n\n\n', '\nimport collections\n\nn = int(input())\n\nss = []\nfor _ in range(n):\n ss.append(input())\n\nc = collections.Counter(ss)\n\nl = c.most_common()\n\nprint(l[0][0])\nfor i in range(len(l)-1):\n if l[i][1] == l[i+1][1]:\n print(l[i+1][0])\n else:\n break\n\n\n', "\nimport collections\n\nn = int(input())\n\nss = []\nfor _ in range(n):\n ss.append(input())\n\nc = collections.Counter(ss)\n\nl = c.most_common()\nans = []\nans.append(l[0][0])\nfor i in range(len(l)-1):\n if l[i][1] == l[i+1][1]:\n ans.append(l[i+1][0])\n else:\n break\n\nans.sort()\n\nprint('\\n'.join(ans))\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s042523128', 's525108430', 's631546040'] | [45032.0, 46872.0, 50288.0] | [440.0, 616.0, 679.0] | [241, 247, 298] |
p02773 | u441320782 | 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())\nlis=list(input() for _ in range(N))\nans=[]\nhigh=0\n\ncounter=Counter(lis)\nhigh=counter.most_common()[0][1]\n\nfor j in se:\n if lis.count(j)==high:\n ans.append(j)\nans.sort()\n\nfor k in ans:\n print(k)', 'from collections import Counter\nN=int(input())\nlis=list(input() for _ in range(N))\nans=[]\n\ncounter=Counter(lis)\nhigh=counter.most_common()[0][1]\n\nfor k,v in counter.most_common():\n if v==high:\n ans.append(k)\n else:\n break\nans.sort()\nfor i in ans:\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s130086977', 's619303663'] | [45044.0, 45048.0] | [423.0, 735.0] | [246, 265] |
p02773 | u442877951 | 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(map(str,input().split()))\ncollections.Counter(S)\nprint(max(collections.Counter(S)))\n', 'from collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\nCS = Counter(S)\nmath = 0\nans = []\nfor i in CS.values():\n v = max(v,i)\nfor i,j in CS.items():\n if v == j:\n ans.append(i)\nans.sort\nprint(ans[i] for i in range(len(ans)))\n\n', 'rom collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\nCS = Counter(S)\nv = 0\nans = []\nfor i in CS.values():\n v = max(v,i)\nfor i,j in CS.items():\n if v == j:\n ans.append(i)\nans.sort()\nprint(ans[i] for i in range(len(ans)))', 'rom collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\nCS = Counter(S)\nv = 0\nans = []\nfor i in CS.values():\n v = max(v,i)\nfor i,j in CS.items():\n if v == j:\n ans.append(i)\nans.sort\nprint(ans[i] for i in range(len(ans)))', 'from collections import Counter\nN = int(input())\nS = [input() for _ in range(N)]\nCS = Counter(S)\nv = 0\nans = []\nfor i in CS.values():\n v = max(v,i)\nfor j,k in CS.items():\n if v == k:\n ans.append(j)\nans.sort()\nprint(ans)', 'from collections import Counter\nN = int(input())\nS = [str(input()) for _ in range(N)]\n\nSC = Counter(S)\nmax_count = max(SC.values())\n\nans = []\n\nfor key,value in SC.items():\n if value == max_count:\n ans.append(key)\n\nans.sort()\n\nfor i in range(len(ans)):\n print(ans[i])'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s626595244', 's761295683', 's768298294', 's874223673', 's927444472', 's122236058'] | [3316.0, 35572.0, 2940.0, 2940.0, 37748.0, 35568.0] | [22.0, 302.0, 17.0, 17.0, 587.0, 682.0] | [129, 256, 252, 250, 225, 271] |
p02773 | u443151804 | 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 *\n_,*a=map(lambda x:x.rstrip(), open(0))\na=Counter(a).most_common()\na=[i[0] for i in a if i[1]==a[0][1]]\nprint(*a,sep="\\n")', 'import sys,collections\ns=collections.Counter(map(lambda x: x.rstrip(),sys.stdin.readlines()[1:])).most_common()\nprint(*[i[0] for i in s if i[1]==s[0][1]],sep="\\n")', 'from collections import *\n_,*a=map(lambda x:x.rstrip(), open(0))\na=Counter(a).most_common()\na=sorted([i[0] for i in a if i[1]==a[0][1]])\nprint(*a,sep="\\n")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s151791020', 's840043991', 's666633054'] | [45036.0, 49248.0, 45028.0] | [324.0, 334.0, 485.0] | [147, 163, 155] |
p02773 | u446774692 | 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())\n\nfrom collections import Counter\nls = Counter(S).most_common()\nMAX = ls[0][1]\n\nfor s,length in ls:\n if MAX == length:\n print(s)\n else:\n exit()\n', "N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\n\nfrom collections import Counter\nls = Counter(S).most_common()\nMAX = ls[0][1]\nans = []\nfor s,length in ls:\n if MAX == length:\n ans.append(s)\n else:\n break;\n\nans.sort()\nprint(*ans,sep='\\n')"] | ['Wrong Answer', 'Accepted'] | ['s047644045', 's934082767'] | [45068.0, 45068.0] | [551.0, 711.0] | [228, 273] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.