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 | u771167374 | 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())\nls = [input() for i in range(n)]\ndict = Counter(ls)\nprint(max(dict))', 'from collections import Counter\nn = int(input())\nl = [input() for i in range(n)]\nls = Counter(l)\nmost_num = ls.most_common()[0][1]\nkeymost = [i for i, j in ls.items() if j == most_num]\nkeymost.sort()\nfor k in keymost:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s482588854', 's994190574'] | [35572.0, 45040.0] | [307.0, 664.0] | [117, 230] |
p02773 | u773440446 | 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)]\nan = list(set(l))\nalm = []\nfor i in range(len(an)):\n alm.append(l.count(an[i]))\n \nans = max(alm)\n\nfor i in range(len(an)):\n if alm[i] == ans:\n print(an[i])', 'from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\nnum = Counter(s)\nmx = max(num.values())\nfor i in sorted(num):\n if num[i] == mx:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s491908824', 's165723210'] | [35676.0, 38880.0] | [2206.0, 427.0] | [220, 180] |
p02773 | u774539708 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n=int(input())\nD={}\nfor i in range(n):\n s=input()\n if s in D:\n D[s]+=1\n else:\n D[s]=1\nM=max(D.values())\nfor d in D:\n if D[d]==M:\n print(d)', 'n=int(input())\nD={}\nfor i in range(n):\n s=input()\n if s in D:\n D[s]+=1\n else:\n D[s]=1\nM=max(D.values())\nans=[]\nfor d in D:\n if D[d]==M:\n ans.append(d)\nprint(*sorted(ans),sep="\\n")'] | ['Wrong Answer', 'Accepted'] | ['s169693124', 's758455012'] | [32096.0, 34008.0] | [465.0, 655.0] | [171, 212] |
p02773 | u777394984 | 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 resolve():\n import collections\n n = int(input())\n c = list(collections.Counter([int(input()) for _ in range(n)]).most_common())\n s = []\n m = c[0][0]\n for i in c:\n if c !=m:\n break\n s.append(i[0])\n s.sort()\n print("\\n".join(s))\nresolve()', 'def resolve():\n import collections\n n = int(input())\n c = list(collections.Counter([input() for _ in range(n)]).most_common())\n s = []\n m = c[0][1]\n for i in c:\n if i[1] !=m:\n break\n s.append(i[0])\n s.sort()\n print("\\n".join(s))\nresolve()'] | ['Runtime Error', 'Accepted'] | ['s702419552', 's789233586'] | [3316.0, 43556.0] | [21.0, 573.0] | [289, 287] |
p02773 | u780475861 | 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\nimport sys\nn = int(sys.stdin.readline())\nsn = sys.stdin.read().split()\nc = Counter(sn)\nc = sorted(c.items(), key=lambda x: (x[1], x[0]))\nnum = c[0][1]\nfor i, j in c:\n if j == num:\n print(i)\n else:\n quit()', "from collections import Counter\nimport sys\nn = int(sys.stdin.readline())\nsn = sys.stdin.read().split()\nc = Counter(sn)\nnum = max(c.values())\nans = [i for i, j in c.items() if j == num]\nans.sort()\nprint('\\n'.join(ans))"] | ['Wrong Answer', 'Accepted'] | ['s642256175', 's396566181'] | [60532.0, 38476.0] | [702.0, 283.0] | [244, 217] |
p02773 | u780565479 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n d[s] = d[s]+1 if (s in d) else 1\nd_sorted = sorted(d.items(), key=lambda x:x[1], reverse=True)\nm = d_sorted[0][1]\nfor i in range(n):\n if d_sorted[i][1]!=m:\n break\n print(d_sorted[i][0])', "n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n d[s] = d[s]+1 if (s in d) else 1\nd_sorted = sorted(d.items(), key=lambda x:x[1], reverse=True)\nm = d_sorted[0][1]\nresult = []\nfor i in d_sorted:\n if i[1]!=m:\n break\n result.append(i[0])\nprint(*sorted(result), sep='\\n')"] | ['Runtime Error', 'Accepted'] | ['s820617479', 's177123164'] | [44892.0, 48220.0] | [565.0, 667.0] | [261, 294] |
p02773 | u781758937 | 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\n\nN = int(input())\n\nS = []\ncnt = []\nfor i in range(N):\n s = input()\n if s in S:\n cnt[S.index(s)] += 1\n else:\n S.append(s)\n cnt.append(1)\n\ncnt = np.array(cnt)\nS = np.array(S)\n\nans = S[cnt==cnt.max()]\nans.sort()\n\nprint(ans)\n\nfor s in ans:\n print(s)', 'N = int(input())\n\nd = {}\nfor i in range(N):\n s = input()\n if s in d.keys():\n d[s] += 1\n else:\n d[s] = 1\n\nM = max(d.values())\nfor j,k in sorted(d.items()):\n if k == M:\n print(j)'] | ['Wrong Answer', 'Accepted'] | ['s441588093', 's021583557'] | [15304.0, 44124.0] | [2108.0, 845.0] | [277, 189] |
p02773 | u782009499 | 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 i in range(n)]\nd = {}\nfor name in s:\n if name in d.keys():\n d[name] = d[name] + 1\n else:\n d.setdefault(name, 1)\nmax_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]\nfor i in max_k_list:\n print(i)', 'n = int(input())\ns = [str(input()) for i in range(n)]\nsorted_s = sorted(s)\ncount = 1\nmax = 1\nans_list = []\nprev = sorted_s[0]\nfor i in sorted_s[1:]:\n if i == prev:\n count += 1\n else:\n if count > max:\n ans_list = [prev]\n max = count\n elif count == max:\n ans_list.append(prev)\n prev = i\n count = 1\nif count > max:\n ans_list = [prev]\nelif count == max:\n ans_list.append(prev)\nfor i in ans_list:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s401678449', 's545613521'] | [35216.0, 22180.0] | [2105.0, 669.0] | [273, 484] |
p02773 | u789840108 | 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 = {}\n\nfor i in range(n):\n ss = input()\n\n if ss in s:\n s[ss] += 1\n else:\n s[ss] = 1\n\ns2 = sorted(s.items(), key=lambda x:x[1])\n\ns2.reverse()\n\nmax_value = s2[0][1]\nret = []\n\nfor sss in s2:\n if sss[1] == max_value:\n ret.append(sss[0])\n else:\n break\n\nret2 = sorted(ret)\nprint(ret2)', 'n = int(input())\ns = {}\n\nfor i in range(n):\n ss = input()\n\n if ss in s:\n s[ss] += 1\n else:\n s[ss] = 1\n\ns2 = sorted(s.items(), key=lambda x:x[1])\n\ns2.reverse()\n\nmax_value = s2[0][1]\nret = []\n\nfor sss in s2:\n if sss[1] == max_value:\n ret.append(sss[0])\n else:\n break\n\nret2 = sorted(ret)\nret2.reverse()\nprint(ret2)', 'n = int(input())\ns = {}\n\nfor i in range(n):\n ss = input()\n\n if ss in s:\n s[ss] += 1\n else:\n s[ss] = 1\n\ns2 = sorted(s.items(), key=lambda x:x[1])\n\ns2.reverse()\n\nmax_value = s2[0][1]\nret = []\n\nfor sss in s2:\n if sss[1] == max_value:\n ret.append(sss[0])\n else:\n break\n\nret2 = sorted(ret)\nfor r in ret2:\n print(r)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s446413892', 's482592591', 's215518492'] | [51932.0, 51676.0, 47324.0] | [692.0, 650.0, 741.0] | [339, 354, 355] |
p02773 | u795928154 | 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 = []\nmaxnum = 0\nmaxyouso = []\nfor kai in range (N):\n S.append(input())\nfor num in S:\n if S.count(num) > maxnum:\n maxnum = S.count(num)\nfor num in S:\n if S.count(num) == maxnum:\n maxyouso.append(num)\nmaxyouso = (set(maxyouso))\nfor j in maxyouso:\n print(j)', 'N = int(input())\nS = []\nmaxnum = 0\nmaxyouso = {}\nanslist = []\nfor kai in range (N):\n S.append(input())\nfor moji in S:\n if moji not in maxyouso:\n maxyouso[moji] = 1\n else:\n maxyouso[moji] = maxyouso[moji] + 1\nprint(maxyouso)\nfor num in maxyouso:\n if maxyouso[num] > maxnum:\n maxnum = maxyouso[num]\nfor num in maxyouso:\n if maxyouso[num] == maxnum:\n anslist.append(num)\nanslist.sort()\nfor k in anslist:\n print(k)', 'N = int(input())\nS = []\nmaxnum = 0\nmaxyouso = []\nfor kai in range (N):\n S.append(input())\nfor num in S:\n if S.count(num) > maxnum:\n maxnum = S.count(num)\nfor num in S:\n if S.count(num) == maxnum:\n maxyouso.append(num)\nmaxysouso = set(maxyouso)\nmaxyouso.sort()\nfor j in maxyouso:\n print(j)', 'N = int(input())\nS = []\nmaxnum = 0\nmaxyouso = {}\nanslist = []\nfor kai in range (N):\n S.append(input())\nfor moji in S:\n if moji not in maxyouso:\n maxyouso[moji] = 1\n else:\n maxyouso[moji] = maxyouso[moji] + 1\nfor num in maxyouso:\n if maxyouso[num] > maxnum:\n maxnum = maxyouso[num]\nfor num in maxyouso:\n if maxyouso[num] == maxnum:\n anslist.append(num)\nanslist.sort()\nfor k in anslist:\n print(k)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s263408670', 's786775841', 's971790643', 's214498025'] | [18840.0, 39424.0, 18840.0, 35220.0] | [2104.0, 784.0, 2105.0, 665.0] | [299, 456, 314, 440] |
p02773 | u796842765 | 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)]\nimport collections\nc = collections.Counter(S)\nA = sorted(c.items(), key=lambda x: x[1], reverse=True)\ncount = 0\nfor a, b in A:\n if b >= count:\n print(a)\n count = b\n else:\n exit()', 'N = int(input())\nS = [input() for _ in range(N)]\nimport collections\nc = collections.Counter(S)\nA = sorted(c.items(), key=lambda x: x[1], reverse=True)\ncount = 0\nB = []\nfor a, b in A:\n if b >= count:\n B.append(a)\n count = b\n else:\n break\n\nC = sorted(B)\nfor a in C:\n print(a)'] | ['Wrong Answer', 'Accepted'] | ['s898131362', 's010007478'] | [46900.0, 49224.0] | [552.0, 720.0] | [254, 303] |
p02773 | u797550216 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\n\nwords = [input() for i in range(n)]\n\ndic = {}\n\nfor word in words:\n if not word in dic:\n dic[word] = 1\n \n else:\n dic[word] += 1\n\nans = [k for k, v in dic.items() if v == max(dic.values())]\n\nfor i in ans:\n print(i)', 'n = int(input())\ndic = {}\n\nfor word in range(n):\n word = input()\n if not word in dic:\n dic[word] = 1\n else:\n dic[word] += 1\nmax_v = max(dic.values())\nans = [kv[0] for kv in dic.items() if kv[1] == max_v]\n\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s422500966', 's581769500'] | [35220.0, 32096.0] | [2105.0, 656.0] | [256, 265] |
p02773 | u798260206 | 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 i in range(N)]\ns=Counter(S)\nm=max(s.values())\ns=sorted(s.items() ,key=lambda s:s[0])\n\nprint(s)\n', 'from collections import Counter\nN=int(input())\nS=[input() for i in range(N)]\ns=Counter(S)\nm=max(s.values())\ns=sorted(s.items() ,key=lambda s:s[0])\nfor a in s:\n if a[1]==m:\n print(a[0])\n'] | ['Wrong Answer', 'Accepted'] | ['s660975112', 's608635711'] | [46572.0, 46620.0] | [699.0, 715.0] | [157, 195] |
p02773 | u799215419 | 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. | ['dct = {}\nfor i in range(N):\n S = input()\n if dct.get(S) == None:\n dct[S] = 1\n else:\n dct[S] += 1\nsortedDct = sorted(dct.items(), key=lambda x: -x[1])\nL = []\nmaxNum = 0\nfor k, v in sortedDct:\n if (maxNum <= v):\n L.append(k)\n maxNum = v\nL.sort()\nfor l in L:\n print(l)', 'N = int(input())\ndct = {}\nfor i in range(N):\n S = input()\n if dct.get(S) == None:\n dct[S] = 1\n else:\n dct[S] += 1\nsortedDct = sorted(dct.items(), key=lambda x: -x[1])\nL = []\nmaxNum = 0\nfor k, v in sortedDct:\n if (maxNum <= v):\n L.append(k)\n maxNum = v\nL.sort()\nfor l in L:\n print(l)'] | ['Runtime Error', 'Accepted'] | ['s675791771', 's633697588'] | [3064.0, 45784.0] | [17.0, 748.0] | [308, 325] |
p02773 | u801009312 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['# coding: utf-8\n# Your code here!\n\nimport collections\na = int(input())\nli1 = []\n \nfor i in range(a):\n li1.append(str(input()))\n \nc = collections.Counter(li1)\n\nprint(c)\n \nsorted_items = sorted(\n c.most_common(),\n key = lambda x:(x[1],x[0]), reverse=True)\n \nprint(sorted_items)\n \nkey, value = zip(*sorted_items)\nli2 = []\nli2.append(key[0])\nfor i in range(1,len(key)):\n if(value[0] == value[i]):\n li2.append(key[i])\n else:\n break;\n\nlist.sort(li2)\n\nfor i in range(len(li2)):\n print(li2[i])', '# coding: utf-8\n# Your code here!\n\nimport collections\na = int(input())\nli1 = []\n \nfor i in range(a):\n li1.append(str(input()))\n \nc = collections.Counter(li1)\n\nprint(c)\n \nsorted_items = sorted(\n c.most_common(),\n key = lambda x:(x[1],x[0]), reverse=True)\n \nprint(sorted_items)\n \nkey, value = zip(*sorted_items)\nprint(key[0])\nfor i in range(1,len(key)):\n if(value[0] == value[i]):\n print(key[i])\n else:\n break;', '# coding: utf-8\n# Your code here!\n\nimport collections\na = int(input())\nli1 = []\n \nfor i in range(a):\n li1.append(str(input()))\n \nc = collections.Counter(li1)\n \nsorted_items = sorted(\n c.most_common(),\n key = lambda x:(x[1],x[0]), reverse=True)\n \nkey, value = zip(*sorted_items)\nli2 = []\nli2.append(key[0])\nfor i in range(1,len(key)):\n if(value[0] == value[i]):\n li2.append(key[i])\n else:\n break;\n\nlist.sort(li2)\n\nfor i in range(len(li2)):\n print(li2[i])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s472145187', 's522043267', 's704648446'] | [75076.0, 75104.0, 62448.0] | [1412.0, 1502.0, 1306.0] | [514, 434, 481] |
p02773 | u801049006 | 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\n count = dict()\n for i in range(N):\n s = input()\n try:\n count[s] += 1\n except:\n count[s] = 1\n \n sort_ = sorted(count.items(), key=lambda x:x[0], reverse=True)\n\n max_value = sort_[0][1]\n item = []\n for key,value in sort_:\n print(value)\n if value == max_value:\n item.append(key)\n else:\n break\n \n item.sort()\n for ans in item:\n print(ans)\n \n\nif __name__ == '__main__':\n main()", "def main():\n N = int(input())\n S = []\n unique = set()\n for i in range(N):\n s = input()\n S.append(s)\n unique.add(s)\n \n count = []\n for u in unique:\n count.append(S.count(u))\n\n max_index = [i for i, x in enumerate(count) if x == max(count)]\n \n for index_ in max_index:\n print(S[index_])\n \n\nif __name__ == '__main__':\n main()", "def main():\n N = int(input())\n\n count = dict()\n for i in range(N):\n s = input()\n try:\n count[s] += 1\n except:\n count[s] = 1\n \n sort_ = sorted(count.items(), key=lambda x:x[1], reverse=True)\n\n max_value = sort_[0][1]\n item = []\n for key,value in sort_:\n if value == max_value:\n item.append(key)\n else:\n break\n \n item.sort()\n for ans in item:\n print(ans)\n \nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s510298758', 's746885292', 's730114795'] | [46940.0, 27880.0, 45784.0] | [964.0, 2105.0, 868.0] | [540, 393, 514] |
p02773 | u805552010 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc = collections.Counter(s)\nc2 = c.most_common()\na = c2[0][1]\nans = []\n\nfor i in range(len(c)):\n ans.append(c2[i][0])\n\nans.sort()\nprint(*ans,sep="\\n")\n', 'from collections import Counter\n\nn = int(input())\ns = [input() for _ in range(n)]\n\nc =Counter(s)\nc2 = c.most_common()\na = c2[0][1]\nans = []\n\nfor i in range(len(c)):\n if c2[i][1] == a:\n ans.append(c2[i][0])\nans.sort()\nprint(*ans,sep="\\n")\n'] | ['Wrong Answer', 'Accepted'] | ['s874894483', 's177637667'] | [50304.0, 50164.0] | [710.0, 669.0] | [223, 248] |
p02773 | u808799019 | 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, strings, answers = int(input()), [], []\nfor x in range(N):\n string = input()\n strings.append(string)\nmax_char = strings.count(max(strings, key=strings.count))\nfor x in strings:\n if strings.count(x) == max_char:\n answers.append(x)\nfor x in set(answers):\n print(x)', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s035890816', 's498851143'] | [17056.0, 45268.0] | [2105.0, 1167.0] | [284, 389] |
p02773 | u810066979 | 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 i in range(n)]\nc = collections.Counter(s)\nnum = c.most_common()[0][1]\nlist=[]\nfor i in range(len(c)):\n\tif num == c.most_common()[i][1]:\n\t\tprint(c.most_common()[i][0])\n\t\t#list.append(c.most_common()[i][0])', ' int(input())\nd = dict()\n \nfor i in range(n):\n s = input()\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n \nM = max(d.values())\n \nans_list = []\nfor k,v in d.items():\n if v == M:\n ans_list.append(k)\n \nans_list.sort()\nfor i in ans_list:\n print(i)', 'import collections\nn = int(input())\ns = [input() for i in range(n)]\nc = collections.Counter(s)\nnum = c.most_common()[0][1]\nlist=[]\nfor i in range(len(c)):\n\tif num == c.most_common()[i][1]:\n\t\tlist.append(c.most_common()[i][0])\nlist = sorted(list,reverse=True)\nfor i in list:\n\tprint(i)', 'n = int(input())\nd = dict()\n\nfor i in range(n):\n s = input()\n if s in d:\n d[s] += 1\n else:\n d[s] = 1\n\nM = max(d.values())\n\nans_list = []\nfor k,v in d.items():\n if v == M:\n ans_list.append(k)\n\nans_list.sort()\nfor i in ans_list:\n print(i)\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s356248953', 's529615218', 's689131637', 's511206977'] | [45040.0, 2940.0, 45324.0, 32096.0] | [2106.0, 17.0, 2106.0, 637.0] | [257, 273, 283, 273] |
p02773 | u812867074 | 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)]\nl.sort()\ni = 0\nmax = 1\ncount = 1\nans = []\n\nwhile i < n-1:\n if l[i] == l[i+1]:\n count += 1\n i += 1\n if i == n-1 and count >= max:\n ans.append(l[n-1])\n\n else:\n if count >= max:\n max = count\n ans.append(l[i])\n count = 1\n i += 1\n else:\n count = 1\n i += 1\n\nif max == 1:\n ans.append(l[n-1])\n \nfor i in ans:\n print(i)\n', 'l = [input() for i in range(n)]\nl.sort()\ni = 0\ncount = 1\nans = []\nmax = 1\nwhile i < n-1:\n if l[i] == l[i+1]:\n count += 1\n i += 1\n if count >= max:\n max = count\n if i == n-1:\n ans.append([l[n-1], count])\n\n else:\n ans.append([l[i],count])\n count = 1\n i += 1\n\nfor i in ans:\n if i[1] == max:\n print(i[0])\n\n\n\n', 'n = int(input())\nl = [str(input()) for i in range(n)]\nl.sort()\ni = 0\ncount = 1\nans = []\nmax = 1\nwhile i < n-1:\n if l[i] == l[i+1]:\n count += 1\n i += 1\n if count >= max:\n max = count\n if i == n-1:\n ans.append([l[n-1], count])\n\n else:\n ans.append([l[i],count])\n count = 1\n i += 1\n\nif max == 1:\n ans.append([l[n-1], 1])\n \nfor i in ans:\n if i[1] == max:\n print(i[0])\n\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s351706669', 's754756604', 's090030573'] | [3064.0, 3064.0, 39112.0] | [19.0, 18.0, 775.0] | [402, 347, 415] |
p02773 | u815754241 | 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. | ['inpvals = []\nlopvals = []\noutvals = []\n\nmax_loop = int(input())\nidx_loop = 0\nwhile idx_loop < max_loop :\n inpvals.append(input())\n idx_loop = idx_loop+1\n\nmax_cnt = 0\nlopvals = set(inpvals)\nfor inpval in inpvals :\n cnt = inpvals.count(inpval)\n\n if max_cnt <= cnt :\n if max_cnt != cnt :\n outvals = []\n max_cnt = cnt\n outvals.append(inpval)\n\noutvals.sort()\n \nfor outval in outvals :\n print(outval)', 'from collections import defaultdict\nfrom collections import OrderedDict\n\nN = int(input())\n\nwords = dict()\nwordsFromValue = defaultdict(list)\n\nfor idx in range(N) :\n word = str(input())\n \n if word in words :\n words[word] += 1\n else :\n words[word] = 1\n \nfor key, value in sorted(words.items()) :\n wordsFromValue[value].append(key)\n \nfor val in wordsFromValue[max(wordsFromValue)] : \n print(val)'] | ['Wrong Answer', 'Accepted'] | ['s431453276', 's320049411'] | [29076.0, 45268.0] | [2108.0, 893.0] | [416, 406] |
p02773 | u816070625 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nimport itertools\n\nN=int(input())\nA=[]\n\n\nfor i in range(N):\n A.append(input())\n\ncounter = collections.Counter(A)\n\nmode_v = counter.most_common()[0][-1]\n\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nfor k,v in it:\n print(k)\n', 'import collections\nimport itertools\n\nN=int(input())\nA=[]\nB=[]\n\n\nfor i in range(N):\n A.append(input())\n\ncounter = collections.Counter(A)\n\nmode_v = counter.most_common()[0][-1]\n\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nfor k,v in it:\n B.append(k)\nB.sort()\n\nfor i in range(len(B)):\n print(B[i])\n'] | ['Wrong Answer', 'Accepted'] | ['s145700935', 's627115094'] | [46888.0, 45080.0] | [606.0, 882.0] | [282, 338] |
p02773 | u816637025 | 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)]\nu = set(s)\n\nw = []\nm = 0\nfor x in u:\n n = sum([1 for i in s if i == x])\n if n > m:\n m = n\n w.clear()\n w.append(x)\n elif n == m:\n w.append(x)\n\nprint(sorted(w))', 'n = int(input())\ns = [input() for _ in range(n)]\n\nd = {}\nm = 0\nfor x in s:\n if x in d:\n d[x] += 1\n m = max(m, d[x])\n else:\n d[x] = 0\n\nprint(sorted({k:v for k, v in d.items() if v == m}.keys()))', 'n = int(input())\ns = [input() for _ in range(n)]\n\nd = {}\nm = 0\nfor x in s:\n if x in d:\n d[x] += 1\n m = max(m, d[x])\n else:\n d[x] = 0\n\nfor x in sorted({k:v for k, v in d.items() if v == m}.keys()):\n print(x)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s075944276', 's885846932', 's923762858'] | [29076.0, 53516.0, 53520.0] | [2108.0, 616.0, 666.0] | [244, 220, 236] |
p02773 | u818349438 | 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())\ns = Counter(s)\nprint(s.most_common()[0][0])\ni = 1\np = []\nwhile i < len(s.most_common()) and s.most_common()[i][1] == s.most_common()[0][1] :\n p.append(str(s.most_common()[i][0]))\n i+=1\np = sorted(p)\nfor i in range(len(p)):\n print(p[i])', 'n = int(input())\nsen = {}\nmaxsen = 0\nfor i in range(n):\n s = input()\n if s not in sen:\n sen[s] = 1\n maxsen = max(maxsen,sen[s])\n else:\n sen[s]+=1\n maxsen = max(maxsen,sen[s])\np = []\nfor key in sen:\n val = sen[key]\n if val == maxsen:\n p.append(key)\np = sorted(p)\nfor x in p:\n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s786944248', 's220438211'] | [43476.0, 33112.0] | [2106.0, 753.0] | [342, 337] |
p02773 | u820284192 | 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())\nList=[input() for i in range(N)]\n\nc = collections.Counter(List)\nc_sorted = sorted(c.items(), key=lambda x:x[1],reverse=True)\n\nmaxCount = c_sorted[0][1]\nkeys = [k for k, v in c.items() if v ==maxCount]\nfor s in keys:\n print(s)', 'import collections\nN = int(input())\nList=[input() for i in range(N)]\n \nc = collections.Counter(List)\nc_sorted = sorted(c.items(), key=lambda x:x[1],reverse=True)\n \nmaxCount = c_sorted[0][1]\nkeys = [k for k, v in c.items() if v ==maxCount]\nkeys.sort()\nfor s in keys:\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s516552558', 's310746803'] | [47020.0, 47632.0] | [589.0, 723.0] | [264, 278] |
p02773 | u821775079 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\ns = [input() for i in range(n)]\nd = {}\nfor i in s:\n if i in d.keys():\n d[i]=d[i]+1\n else:\n d[i]=1\nd_sorted = sorted(d.items(), key=lambda x:x[1])\nd_name = [x[0] for x in d_sorted if x[1] == d_sorted[-1][0]]\nd_name.sort()\nprint("\\n".join(d_name))', 'n = int(input())\ns = [input() for i in range(n)]\nd = {}\nfor i in s:\n if i in d.keys():\n d[i]=d[i]+1\n else:\n d[i]=1\nd_sorted = sorted(d.items(), key=lambda x:x[1])\nd_name = [x[0] for x in d_sorted if x[1] == d_sorted[-1][1]]\nd_name.sort()\nprint("\\n".join(d_name))'] | ['Wrong Answer', 'Accepted'] | ['s976564431', 's779535525'] | [44792.0, 49936.0] | [455.0, 600.0] | [282, 282] |
p02773 | u823885866 | 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\nn = int(sys.stdin.readline())\nli = []\nfor _ in range(n):\n li.append(sys.stdin.readline().strip())\nli2 = list(set(li)).sort(reverse = True)\ncnt_box = []\nfor i in li2:\n cnt_box.append(li.count(i))\nm = max(cnt_box)\ni = 0\nwhile i < len(cnt_box):\n if cnt_box[i] == m:\n print(li2[i])\n i += 1\n', "import sys\nn = int(sys.stdin.readline())\nli = []\nfor _ in range(n):\n li.append(sys.stdin.readline().strip())\nmax = 0\nli2 = list(set(li))\nli3 = []\nfor i in li2:\n if li.count(i) > max:\n li3 = [i]\n elif li.count(i) == max:\n li3.append(i)\nli3.sort()\nprint('\\n'.join(li3))", "import sys\nimport math\nimport itertools\nimport numpy\nimport collections\n\nrl = sys.stdin.readline\n\nn = int(rl())\n\nli = []\nfor _ in range(n):\n li.append(rl().rstrip())\nc = collections.Counter(li)\nmax_cnt = 0\nli = []\nfor k, v in c.items():\n if v < max_cnt:\n continue\n elif v == max_cnt:\n li.append(k)\n else:\n max_cnt = v\n li = [k]\nli.sort()\nprint('\\n'.join(li))\n\n\n\n"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s506606193', 's552975729', 's040723641'] | [29076.0, 29076.0, 44480.0] | [315.0, 2104.0, 512.0] | [304, 276, 402] |
p02773 | u825378567 | 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())\nans={}\ncnt=0\nfor i in range():\n t=input()\n if not t in ans.keys():\n ans[i]==1\n else:\n ans[i]+=1\n if cnt<ans[i]:\n cnt=ans[i]\ntmp =[]\nfor i in ans.keys():\n if ans[i] == cnt:\n tmp.append(i)\nfor i in sort(tmp):\n print(i)\n', 'N=int(input())\nans={}\ncnt=0\nfor i in range(N):\n t=input()\n if not t in ans.keys():\n ans[t]=1\n else:\n ans[t]+=1\n if cnt<ans[t]:\n cnt=ans[t]\ntmp =[]\nfor i in ans.keys():\n if ans[i] == cnt:\n tmp.append(i)\ntmp.sort()\nfor i in tmp:\n print(i)\n'] | ['Runtime Error', 'Accepted'] | ['s949957697', 's020164409'] | [3060.0, 32096.0] | [17.0, 692.0] | [251, 256] |
p02773 | u829249049 | 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())\nlistS=[]\nfor i in range(N):\n S=input()\n listS+=[S]\nlistS.sort()\ncounter=[]\ncount=1\nfor i in range(N-1):\n if listS[i]==listS[i+1]:\n count+=1\n else:\n counter+=[count]\n count=1\n \ncounter+=[count] \nMAX=max(counter)\ncount=1\n\nfor i in range(N-1):\n if listS[i]==listS[i+1]:\n count+=1\n else:\n count=1\n if count==MAX:\n print(listS[i])\nif count==MAX:\n print(listS[-1]) ', 'from collections import Counter\nN=int(input())\nlistS=[]\nfor i in range(N):\n S=input()\n listS+=[S]\nlistS=Counter(listS)\nlistS=listS.most_common()\nans=[]\nMAX=listS[0][1]\nfor i in range(len(listS)):\n if listS[i][1]==MAX:\n ans+=[listS[i][0]]\n else:\n break \nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s206611138', 's049997872'] | [20680.0, 43476.0] | [761.0, 797.0] | [411, 300] |
p02773 | u829416877 | 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 \u3000d[S] = 1\nm = max(d.values())\nfor s in sorted(k for k in d if d[k] == m):\n print(s)', '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\nm = max(d.values())\nfor s in sorted(k for k in d if d[k] == m):\n print(s)'] | ['Runtime Error', 'Accepted'] | ['s185256227', 's613308291'] | [8956.0, 35416.0] | [27.0, 435.0] | [181, 179] |
p02773 | u835322333 | 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 i in range(N)]\n\n\nc = collections.Counter(S)\nvalue,count = zip(*c.most_common(len(c)))\n\nif len(set(count)) == 1:\n s = sorted(value)\n for i in s:\n print(i)\nelse:\n for i in value:\n print(i)\n exit()', 'import collections\nN = int(input())\nS = [input() for i in range(N)]\n\nc = collections.Counter(S)\nvalue,count = zip(*c.most_common())\n\ns = sorted(value)\nans = []\nif len(set(count)) == 1 :\n for i in s:\n print(i)\nelse: \n for i in range(len(value)):\n ans.append(value[i])\n if count[i] > count[i+1]:\n [print(i) for i in sorted(ans)]\n exit()'] | ['Wrong Answer', 'Accepted'] | ['s850972702', 's587114526'] | [59368.0, 59508.0] | [758.0, 799.0] | [296, 383] |
p02773 | u838786721 | 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\n\nc = collections.Counter(s)\nl = [kv[0] for kv in c.items() if kv[1] == max(c.values())]\n\nfor i in l:\n print(i)', 'n = int(input())\ns = {}\nm = 1\nfor i in range(n):\n p = input()\n if p in s:\n s[p] += 1\n if m < s[p]:\n m = s[p]\n else:\n s[p] = 1\n\nl = [kv[0] for kv in s.items() if kv[1] == m]\n\nl.sort()\n\nfor i in l:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s099911783', 's892655585'] | [35476.0, 32096.0] | [2105.0, 686.0] | [194, 223] |
p02773 | u840310460 | 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. | ['ans = {}\nfor i in S:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\n\nmax_v = max(ans.values()) \nANS = []\nfor key, value in ans.items():\n if ans[key] == max_v:\n ANS.append(key)\n\nfor i in sorted(ANS):\n print(i)', 'N = int(input())\nS = [input() for i in range(N)]\n\nans = {}\nfor i in S:\n if i in ans:\n ans[i] += 1\n else:\n ans[i] = 1\n\nmax_v = max(ans.values()) \nANS = []\nfor key, value in ans.items():\n if ans[key] == max_v:\n ANS.append(key)\n\nfor i in sorted(ANS):\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s122708325', 's990709179'] | [3060.0, 35216.0] | [17.0, 710.0] | [247, 297] |
p02773 | u840570107 | 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())\nlis = []\nlis2 = {}\nlis3 = []\nfor _ in range(n):\n lis.append(input())\n\nfor w in lis:\n if w not in lis2.keys():\n lis2[w] = 1\n else:\n lis2[w] += 1\n\nma = max(lis2.values())\n\nfor k, v in lis2.items():\n if v == ma:\n lis3.append(k)\n\nfor a in lis3:\n print(a)', 'n = int(input())\nlis = []\nlis2 = {}\nlis3 = []\nfor _ in range(n):\n lis.append(input())\n\nfor w in lis:\n if w not in lis2.keys():\n lis2[w] = 1\n else:\n lis2[w] += 1\n\nsort_lis2 = sorted(lis2.items(), key=lambda x: x[1], reverse = True)\n\nfor a in range(len(sort_lis2)):\n if a == 0:\n lis3.append(sort_lis2[0][0])\n else:\n if sort_lis2[0][1] == sort_lis2[a][1]:\n lis3.append(sort_lis2[a][0])\n\nfor b in lis3:\n print(b)', 'n = int(input())\nlis = []\nlis2 = {}\nlis3 = []\nfor _ in range(n):\n lis.append(input())\n\nfor w in lis:\n if w not in lis2.keys():\n lis2[w] = 1\n else:\n lis2[w] += 1\n\nsort_lis2 = sorted(lis2.items(), key=lambda x: x[1], reverse = True)\n\nfor a in range(len(sort_lis2)):\n if a == 0:\n lis3.append(sort_lis2[0][0])\n else:\n if sort_lis2[0][1] == sort_lis2[a][1]:\n lis3.append(sort_lis2[a][0])\n\nfor b in lis3:\n print(b)', 'n = int(input())\nlis = []\nlis2 = {}\nlis3 = []\nfor _ in range(n):\n lis.append(input())\n\nfor w in lis:\n if w not in lis2.keys():\n lis2[w] = 1\n else:\n lis2[w] += 1\n\nma = max(lis2.values())\n\nfor k, v in lis2.items():\n if v == ma:\n lis3.append(k)\n\nlis3.sort()\n\nfor a in lis3:\n print(a)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s097084471', 's214164692', 's480133489', 's116406815'] | [35220.0, 46736.0, 46732.0, 35216.0] | [511.0, 598.0, 612.0, 676.0] | [281, 431, 431, 294] |
p02773 | u840958781 | 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=[]\nans=0\nimport collections\nfor i in range(n):\n s=input()\n S.append(s)\nS=sorted(S)\nc=collections.Counter(S)\nANS=[]\nfor i in range(n-1):\n if (S[i]!=S[i+1] and ans<c[S[i]]) or i==n-2:\n ans=c[S[i]]\n ANS.append(ans)\ninko=""\nans=max(ANS)\nfor i in range(n):\n if c[S[i]]==ans and S[i]!=inko:\n print(S[i])', 'n=int(input())\nS=[]\nans=0\nimport collections\nfor i in range(n):\n s=input()\n S.append(s)\nS=sorted(S)\nc=collections.Counter(S)\nANS=[]\nfor i in range(n-1):\n if (S[i]!=S[i+1] and ans<c[S[i]]) or i==n-2:\n ans=c[S[i]]\n ANS.append(ans)\ninko=""\nans=max(ANS)\nfor i in range(n):\n if c[S[i]]==ans and S[i]!=inko:\n print(S[i])\n inko=S[i]'] | ['Wrong Answer', 'Accepted'] | ['s404721521', 's750441580'] | [38504.0, 38504.0] | [801.0, 851.0] | [389, 407] |
p02773 | u840974625 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nList = [input() for i in range(n)]\n\nc = {}\nres = []\n\nfor i in range(n):\n if List[i] in c.keys():\n c[List[i]] += 1\n else:\n c[List[i]] = 1\n\nac = c.most_common() \n \nres.append(ac[0][0])\nfor i in range(1, leng):\n if ac[i][1] >= ac[i-1][1]:\n res.append(ac[i][0])\n else:\n break\n\n\nres.sort()\nfor j in range(len(res)):\n print(res[j])', 'import collections\n\nn = int(input())\nList = [input() for i in range(n)]\nres = []\n\nc = collections.Counter(List)\n\nfor v in c.values():\n m = max(m, v)\n \nfor k, v in c.items():\n if v == m:\n res.append(k)\n \nres.sort()\nfor i in range(les(res)):\n print(res[i])', 'import collections\n\nn = int(input())\nList = [input() for i in range(n)]\nres = []\n\nc = collections.Counter(List)\nm = 0\nfor v in c.values():\n m = max(m, v)\n \nfor k, v in c.items():\n if v == m:\n res.append(k)\n \nres.sort()\nfor i in range(les(res)):\n print(res[i])', 'import collections\n\nn = int(input())\nList = [input() for i in range(n)]\nres = []\n\n#c = collections.Counter(List)\n\nc = {}\n\nfor i in range(n):\n if List[i] in c.keys():\n c[List[i]] += 1\n else:\n c[List[i]] = 1\n\n\nm = 0\nfor v in c.values():\n m = max(m, v)\n\nfor k, v in c.items():\n if v == m:\n res.append(k)\n \nres.sort()\nfor i in range(len(res)):\n print(res[i])\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s222403836', 's511061199', 's578114433', 's139147542'] | [35220.0, 35572.0, 35572.0, 35572.0] | [355.0, 310.0, 634.0, 727.0] | [525, 264, 269, 394] |
p02773 | u849229491 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\nn = int(input())\nS = []\nfor _ in range(n):\n s = input()\n S.append(s)\ncnt = Counter(S)\nl = max(cnt.values())\n\nans = []\nfor k,v in cnt.items():\n if v == l:\n ans.append(k)\nprint(ans)\nans.sort()\nfor i in ans:\n print(i)', 'from collections import Counter\nn = int(input())\nS = []\nfor _ in range(n):\n s = input()\n S.append(s)\ncnt = Counter(S)\nl = max(cnt.values())\n\nans = []\nfor k,v in cnt.items():\n if v == l:\n ans.append(k)\n\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s190831886', 's410964182'] | [39536.0, 35572.0] | [676.0, 673.0] | [257, 247] |
p02773 | u849756457 | 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 \nd = {k: v for k, v in sorted(d.items(), key=lambda item: item[1], reverse=True)}\n\nmax_count = -1\nfor k, v in d.items():\n if max_count < v:\n max_count = v\n if v != max_count:\n break\n print(k)', '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 \nd = {k: v for k, v in sorted(d.items(), key=lambda item: item[1], reverse=True)}\n\nmax_count = -1\nvalues = []\nfor k, v in d.items():\n if max_count < v:\n max_count = v\n if v != max_count:\n break\n values.append(k)\n\nprint("\\n".join(sorted(values)))'] | ['Wrong Answer', 'Accepted'] | ['s157394160', 's202605763'] | [66400.0, 66360.0] | [429.0, 449.0] | [310, 364] |
p02773 | u851035514 | 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())\nS.sort()\nS.append("A")\nprint(S)\nB = []\nM = 1\nT = 1\nfor i in range(N):\n if S[i] == S[i+1]:\n T += 1\n elif T < M:\n T = 1\n elif T == M:\n T = 1\n B.append(S[i])\n else:\n M = T\n T = 1\n B = [S[i]]\n\nfor i in range(B):\n print(B[i])', 'N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\nS.sort()\nS.append("A")\nB = []\nM = 1\nT = 1\nfor i in range(N):\n if S[i] == S[i+1]:\n T += 1\n elif T < M:\n T = 1\n elif T == M:\n T = 1\n B.append(S[i])\n else:\n M = T\n T = 1\n B = [S[i]]\n\nfor i in range(len(B)):\n print(B[i])'] | ['Runtime Error', 'Accepted'] | ['s748439182', 's883353200'] | [25024.0, 20680.0] | [546.0, 658.0] | [349, 345] |
p02773 | u851319680 | 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\n\nN = int(input())\na = input().split()\n\na = np.array(a)\n\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == max(counts_elements)]\nfor i in elements:\n print(i)\n', "import numpy as np\n\nN = int(input())\na = [input() for _ in range(N)]\n\na = np.array(a)\n\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == np.max(counts_elements)]\nfor i in elements:\n print(i)\n print('\\n')", 'N = int(input())\na = list(map(str, input().split()))\n\na = np.array(a)\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == max(counts_elements)]\nfor i in elements:\n print(i)\n', 'import numpy as np\n\nN = int(input())\na = list(map(str, input().split()))\n\na = np.array(a)\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == max(counts_elements)]\nfor i in elements:\n print(i)\n', 'import numpy as np\n\nN = int(input())\na = [input() for _ in range(H)]\n\na = np.array(a)\n\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == np.max(counts_elements)]\nfor i in elements:\n print(i)\n', 'import numpy as np\n\nN = int(input())\na = input().split()\n\na = np.array(a)\n\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == np.max(counts_elements)]\nfor i in elements:\n print(i)\n', "import numpy as np\n\nN = int(input())\na = input().split()\n\na = np.array(a)\n\nunique_elements, counts_elements = np.unique(a, return_counts=True)\nelements = unique_elements[counts_elements == np.max(counts_elements)]\nfor i in elements:\n print(i)\n print('\\n')\n", 'import numpy as np\n\nN = int(input())\na = [input() for _ in range(N)]\n\na = np.sort(np.array(a))\n\nunique_elements, index_elements = np.unique(a, return_index = True)\nl = []\nfor i in range(index_elements.size -1):\n m = index_elements[i + 1] - index_elements[i]\n l.append(m)\nl.append(a.size - index_elements[-1]) \nelements = unique_elements[l == max(l)]\n\n\nfor i in elements:\n\tprint(i)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s103738324', 's131063754', 's761792725', 's770154926', 's817183112', 's836920927', 's956150570', 's809552413'] | [12504.0, 42092.0, 3060.0, 12496.0, 12420.0, 12504.0, 16280.0, 49976.0] | [161.0, 427.0, 19.0, 152.0, 156.0, 153.0, 232.0, 881.0] | [243, 273, 238, 258, 258, 246, 262, 386] |
p02773 | u854962015 | 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=list(input() for i in range(N))\nL=sorted(L)\nX=L[0]\nc=0\nd=0\ne=[]\nfor i in range(N):\n if L[i]==X:\n c+=1\n elif L[i]!=X and d<c:\n d=c\n c=0\n e=[]\n e.append(X)\n X=L[i]\n c+=1\n elif L[i]!=X and d==c:\n c=1\n e.append(X)\n X=L[i]\n if i==N-1:\n e.append(X)\n elif L[i]!=X and d>c:\n c=0\n X=L[i]\n c+=1\nfor i in e:\n print(i)', 'N=int(input())\nL=list(input() for i in range(N))\nL=sorted(L)\nX=L[0]\nc=0\nd=0\ne=[]\nfor i in range(N):\n if L[i]==X:\n c+=1\n if i==N-1 and c>d:\n e=[X]\n elif L[i]!=X and d<c:\n d=c\n c=0\n e=[]\n e.append(X)\n X=L[i]\n c+=1\n elif L[i]!=X and d==c:\n c=1\n e.append(X)\n X=L[i]\n if i==N-1:\n e.append(X)\n elif L[i]!=X and d>c:\n c=0\n X=L[i]\n c+=1\nfor i in e:\n print(i)', 'N=int(input())\nL=list(input() for i in range(N))\nL=sorted(L)\nX=L[0]\nc=0\nd=0\ne=[]\nfor i in range(N):\n if L[i]==X:\n c+=1\n if i==N-1 and c>d:\n e=[X]\n elif i==N-1 and c==d:\n e.append(X)\n elif L[i]!=X and d<c:\n d=c\n c=0\n e=[]\n e.append(X)\n X=L[i]\n c+=1\n elif L[i]!=X and d==c:\n c=1\n e.append(X)\n X=L[i]\n if i==N-1:\n e.append(X)\n elif L[i]!=X and d>c:\n c=0\n X=L[i]\n c+=1\nfor i in e:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s259578100', 's919077385', 's282448785'] | [25488.0, 25420.0, 25536.0] | [484.0, 465.0, 466.0] | [375, 410, 454] |
p02773 | u855570300 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["if __name__ == '__main__':\n N = int(input())\n kv = collections.defaultdict(int)\n max_cnt = 0\n res = []\n for _ in range(N):\n word = input()\n kv[word] += 1\n if kv[word] == max_cnt:\n res.append(word)\n elif kv[word] > max_cnt:\n res = [word]\n max_cnt = kv[word]\n print('\\n'.join(sorted(res)))", "import collections\n\nif __name__ == '__main__':\n N = int(input())\n kv = collections.defaultdict(int)\n max_cnt = 0\n res = []\n for _ in range(N):\n word = input()\n kv[word] += 1\n if kv[word] == max_cnt:\n res.append(word)\n elif kv[word] > max_cnt:\n res = [word]\n max_cnt = kv[word]\n for s in sorted(res):\n print(s)"] | ['Runtime Error', 'Accepted'] | ['s625649964', 's990503233'] | [3064.0, 33680.0] | [17.0, 712.0] | [366, 395] |
p02773 | u857293613 | 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 not in dic:\n dic[s] = 1\n else:\n dic[s] += 1\nm = max(dic.values())\nanslis = []\nfor k, v in dic.items():\n if v == m:\n anslis.append(k)\nprint('/n'.join(anslis))", 'n = int(input())\nlis = [input() for _ in range(n)]\ns = set(lis)\na = []\nfor i in s:\n a.append([lis.count(i), i])\nM = max(s, key=lambda i : i[0])\nfunc = lambda i:i[1] if i[0] == M else None\nanslis = [i[1] for i in s if i[0]==M[0]]\nfor i in anslis:\n print(i)', "n = int(input())\ndic = {}\nfor _ in range(n):\n s = input()\n if s not in dic:\n dic[s] = 1\n else:\n dic[s] += 1\nm = max(dic.values())\nanslis = []\nfor k, v in dic.items():\n if v == m:\n anslis.append(k)\nprint('\\n'.join(sorted(anslis)))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s701420237', 's850663675', 's575788613'] | [34652.0, 29072.0, 34140.0] | [404.0, 2105.0, 578.0] | [254, 261, 262] |
p02773 | u857330600 | 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=[]\nlis=[]\nfor i in range(n):\n s=str(input())\n if not s in set(l):\n l.append(s)\n lis.append([s,0])\n for i in range(len(l[0])):\n if lis[i][0]==s:\n lis[i][1]+=1\n break\ntmp=lis[0][1]\ntmpl=[lis[0][0]]\nfor j in range(1,len(l)):\n if tmp<lis[j][1]:\n tmp=lis[j][1]\n tmpl.clear()\n tmpl.append(lis[j][0])\n elif tmp==l[j][1]:\n tmpl.append(lis[j][0])\ntmpl.sort()\nfor i in range(len(tmpl)):\n print(tmpl[i])', 'from collections import Counter\nn=int(input())\nl=[input() for i in range(n)]\ncount=Counter(l).most_common()\nd,most=[],count[0][1]\nfor si,c in count:\n if c==most:\n d.append(si)\nd.sort()\nfor i in sorted(d):\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s499522220', 's089760983'] | [5452.0, 45040.0] | [2104.0, 717.0] | [446, 219] |
p02773 | u860898526 | 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\nnumber = int(input())\n\narray = []\n\nfor i in range(number):\n array.append(input())\n\ndic = collections.Counter(array).most_common()\n\nmax_dic = [dic[0][0]]\n\nfor i in range(len(dic) - 1):\n if dic[i + 1][1] == dic[0][1]:\n max_dic.append(dic[i + 1][0])\n\nfor i in range(len(max_dic)):\n print(max_dic[i])', 'import collections\n\nnumber = int(input())\n\narray = []\n\nfor i in range(number):\n array.append(input())\n\ndic = collections.Counter(array).most_common()\n\nmax_dic = [dic[0][0]]\n\nfor i in range(len(dic) - 1):\n if dic[i + 1][1] == dic[0][1]:\n max_dic.append(dic[i + 1][0])\n \nmax_dic.sort()\n\nfor i in range(len(max_dic)):\n print(max_dic[i])'] | ['Wrong Answer', 'Accepted'] | ['s445174484', 's259355421'] | [45040.0, 45036.0] | [584.0, 796.0] | [332, 356] |
p02773 | u861340374 | 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=sorted([input() for i in range(n)])\nans = ['']\nx=1\nmax=0\nfor k in range(n):\n if k<n-1:\n if s[k]==s[k+1]:\n x+=1\n else:\n if max<x:\n ans=[s[k]]\n max=x\n if max==x:\n ans.append(s[k])\n x=1\n else:\n if max<x:\n ans=[s[k]]\n max=x\n if max==x:\n ans.append(s[k])\n\n \nprint(0)\nfor j in range(ans.max):\n print(ans[j])", "n=int(input())\ns=sorted([input() for i in range(n)])\nans = ['']\nx=1\nmax=0\nfor k in range(n):\n if k<n-1:\n if s[k]==s[k+1]:\n x+=1\n else:\n if max<x:\n ans=[s[k]]\n max=x\n elif max==x:\n ans.append(s[k])\n x=1\n else:\n if max<x:\n ans=[s[k]]\n max=x\n elif max==x:\n ans.append(s[k])\n\n \n\nfor j in range(len(ans)):\n print(ans[j])"] | ['Runtime Error', 'Accepted'] | ['s552919644', 's045687750'] | [19332.0, 20140.0] | [546.0, 647.0] | [480, 477] |
p02773 | u861886710 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nimport itertools\n\nN = int(input())\nS = []\nfor i in range(N):\n s = input()\n S.append(s)\n\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 = input()\n S.append(s)\n\nret = [letter for letter,count in S.most_common() if count == S.most_common()[0][1]]\nprint(ret)', 'n = int(input())\narr = {input() for _ in range(n)}\ndic={}\n\n\nfor i in range(n):\n if arr[i] not in dic:\n dic[arr[i]] = 1\n else:\n dic[arr[i]] += 1\n\nlargest = max(dic.values())\nans = []\n\nfor keys in dic.keys():\n if dic[keys] == largest:\n ans.append(keys)\n\nans = sorted(ans)\n\nfor words in ans:\n print(words)', 'n = int(input())\narr = {input() for _ in range(n)}\ndic={}\n\n\nfor i in range(n):\n if arr[i] not in dic:\n dic[arr[i]] = 1\n else:\n dic[arr[i]] += 1\n\nlargest = max(dic.values())\nans = []\n\nfor keys in dic.keys():\n if dic[keys] == largest:\n ans.append(keys)\n\nans = sorted(ans)\n\nfor words in ans:\n print(words)', 'n=int(input())\narr=[input() for _ in range(n)]\ndic={}\nfor i in range(n): \n if arr[i] not in dic:\n dic[arr[i]]=1\n else:\n dic[arr[i]]+=1\nlargest=max(dic.values()) \nans=[]\nfor keys in dic.keys():\n if dic[keys]==largest: \n ans.append(keys)\nans=sorted(ans) \nfor words in ans:\n print(words)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s149054826', 's458042643', 's892244731', 's925699040', 's456709892'] | [49732.0, 23400.0, 31084.0, 31112.0, 38452.0] | [402.0, 255.0, 271.0, 279.0, 454.0] | [303, 171, 455, 455, 459] |
p02773 | u863964720 | 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 = [0]*N\nfor i in range(N):\n S[i] = input()\nc = collections.Counter(S)\nvalues,counts = zip(*c.most_common())\nX = c.most_common()[0][1]\nfor i in range(0,len(c.most_common())):\n if c.most_common()[i][1] == X:\n list.append(c.most_common()[i][0])\nlist.sort()\nprint(list)\nfor i in range(len(list)):\n print(list[i])', 'import collections\nN = int(input()) \nS = [0]*N\nfor i in range(N):\n S[i] = input()\nc = collections.Counter(S)\nvalues,counts = zip(*c.most_common())\nX = c.most_common()[0][1]\nprint(X)\nfor i in range(0,len(c.most_common())):\n if c.most_common()[i][1] == X:\n list.append(c.most_common()[i][0])\nlist.sort()\nprint(list)\nfor i in range(len(list)):\n print(list[i])', 'import collections\nN = int(input()) \nS = [0]*N\nm = 0\nfor i in range(N):\n S[i] = input()\nc = collections.Counter(S)\nvalues,counts = zip(*c.most_common())\nX = c.most_common()[0][1]\nlist = []\nfor i in range(0,len(c.most_common())):\n if counts[i] == X:\n list.append(values[i])\n m+=1\n else:\n break\nlist.sort()\nfor i in range(0,m):\n print(list[i])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s240513280', 's308315123', 's019962150'] | [59492.0, 59488.0, 59492.0] | [696.0, 744.0, 945.0] | [363, 372, 374] |
p02773 | u866070271 | 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()\na = input().split("")\nb = list(set([x for x in a if a.count(x) > 1]))\n\nfor i in b:\n print(i)\n', 'n = input()\na = input().split("")\nb = list(set([x for x in a if a.count(x) > 2]))\n\nfor i in b:\n print(i)\n ', 'n = input()\na = input().split(" ")\nb = set([x for x in a if a.count(x) > 1])\n\nfor i in b:\n print(i)\n', 'from collections import defaultdict\nfrom collections import OrderedDict\nN = int(input())\nans = dict()\nfor _ in range(N):\n k = str(input())\n if k in ans:\n ans[k]+=1\n else:\n ans.update({k:1})\ngroupedByValue = defaultdict(list)\nfor key, value in sorted(ans.items()):\n groupedByValue[value].append(key)\nl = groupedByValue[max(groupedByValue)]\nfor i in l:\n print(i)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s065465683', 's236894120', 's308162887', 's570569725'] | [2940.0, 3060.0, 2940.0, 46740.0] | [18.0, 18.0, 17.0, 1074.0] | [108, 108, 103, 389] |
p02773 | u866410186 | 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 solve(n: int, words: list):\n word_map = dict()\n max_count = 0\n for word in words:\n count = word_map.get(word, 0) + 1\n word_map[word] = count\n max_count = max(max_count, count)\n \n for word in sorted(word_map):\n if(word_map[word] == max_count):\n print(word)\n\n\ndef main():\n n = int(input())\n li = []\n for i in range(n):\n li.append(input())\n \n solve(n, li) ', 'def solve(n: int, words: list):\n word_map = dict()\n max_count = 0\n for word in words:\n count = word_map.get(word, 0) + 1\n word_map[word] = count\n max_count = max(max_count, count)\n \n for word in sorted(word_map.keys()):\n if(word_map[word] == max_count):\n print(word)\n\n\ndef main():\n n = int(input())\n li = []\n for i in range(n):\n li.append(input())\n solve(n, li)\n\n\nmain()'] | ['Wrong Answer', 'Accepted'] | ['s041592081', 's114475311'] | [3064.0, 35220.0] | [18.0, 659.0] | [439, 442] |
p02773 | u867736259 | 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. | ['i = int(input())\n\ndic = {}\nfor j in range(i):\n word = input()\n if word in dic:\n dic[word] += 1\n else:\n dic[word] = 1\n\n\ndic2 = sorted(dic.items(), key=lambda x:x[1])\nprint(dic2)\nk = len(dic2)-1\ns = 0\nans = []\nfor p in range(len(dic2)):\n t = dic2[k][1]\n ans.append(dic2[k][0])\n k -= 1\n if t == dic2[k][1]:\n s = 1\n else:\n break\nans.sort(reverse=True)\nfor ak in ans:\n print(ak)\n', 'i = int(input())\n\ndic = {}\nfor j in range(i):\n word = input()\n if word in dic:\n dic[word] += 1\n else:\n dic[word] = 1\n\n\ndic2 = sorted(dic.items(), key=lambda x:x[1])\nprint(dic2)\nk = len(dic2)-1\ns = 0\nans = []\nfor p in range(len(dic2)):\n t = dic2[k][1]\n ans.append(dic2[k][0])\n k -= 1\n if t == dic2[k][1]:\n s = 1\n else:\n break\nans.sort()\nfor ak in ans:\n print(ak)', 'i = int(input())\n\ndic = {}\nfor j in range(i):\n word = input()\n if word in dic:\n dic[word] += 1\n else:\n dic[word] = 1\n\n\ndic2 = sorted(dic.items(), key=lambda x:x[1])\nk = len(dic2)-1\ns = 0\nans = []\nfor p in range(len(dic2)):\n t = dic2[k][1]\n ans.append(dic2[k][0])\n k -= 1\n if t == dic2[k][1]:\n s = 1\n else:\n break\nans.sort()\nfor ak in ans:\n print(ak)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s676250107', 's998596226', 's180124298'] | [53212.0, 53212.0, 45780.0] | [877.0, 973.0, 733.0] | [429, 416, 404] |
p02773 | u868701750 | 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 import sys\n from collections import Counter\n\n N = int(input())\n S = [sys.stdin.readline().rstrip('\\n') for _ in range(N)]\n\n print(S)\n\n c = Counter(S)\n _max = max(c.values())\n\n keys = [k for k, v in c.items() if v == _max]\n\n print('\\n'.join(sorted(keys)))\n\n\nif __name__ == '__main__':\n main()", "def main():\n import sys\n from collections import Counter\n\n N = int(input())\n S = [sys.stdin.readline().rstrip('\\n') for _ in range(N)]\n c = Counter(S)\n _max = max(c.values())\n keys = [k for k, v in c.items() if v == _max]\n print('\\n'.join(sorted(keys)))\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s422025551', 's971923355'] | [40808.0, 35936.0] | [356.0, 353.0] | [334, 316] |
p02773 | u869474504 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nwhile a < N :\n list_a.append(list_S.count(list_S[a]))\n a += list_S.count(list_S[a])\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[i-1]]\n ans += "\\n"\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N)]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n if N == 1:\n ans = list_S[t]\n else:\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n b = 0\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[b]]\n ans += "\\n"\n b += 1\nprint(ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\n\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 0\nlist_a.append(a)\n\nnewlist_a = sorted(list_a,reverse=True)\n\nn = newlist_a.count(newlist_a[0])\nlist_ans = []\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n list_t = []\n list_t.append(list_a.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_a.remove(newlist_a[i])\n list_t.append(list_a.index(newlist_a[i])+1)\n\n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n if N == 1:\n ans = list_S[t]\n else:\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[i-1]]\n ans += "\\n"\nprint(ans)', 'N = int(input())\nlist_S = [input() for i in range(N)]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nA = newlist_a[0]\nn = newlist_a.count(A)\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(A)):\n t += list_a[i]\n if N == 1:\n ans = list_S[t]\n else:\n ans = list_S[t+1]\nelse:\n if A==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n b = 0\n for i,x in enumerate(list_a):\n if x == A:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[b]]\n ans += "\\n"\n b += 1\nprint(ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\n\nlist_ans = []\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_A.remove(newlist_a[i])\n list_t.append(list_A.index(newlist_a[i])+i+1)\n \n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n if newlist_a[0]==1:\n list_ans.append(list_S[m])\n else:\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nans = ""\nfor i in range(len(list_ans)):\n ans += list_ans[i]\n ans += "\\n"\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nwhile a < N :\n list_a.append(list_S.count(list_S[a]))\n a += list_S.count(list_S[a])\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 0\nlist_a.append(a)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nlist_ans = []\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_A.remove(newlist_a[i])\n list_t.append(list_A.index(newlist_a[i])+i+1)\n \n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n if newlist_a[0]==1:\n list_ans.append(list_S[m])\n else:\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)\n', 'import copy\n\nN = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n ans +=list_S[m+t]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_A = copy.copy(list_a)\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(n-1):\n list_A.remove(newlist_a[i])\n m = 0\n for j in range(list_A.index(newlist_a[i])+i+1):\n m += list_a[j]\n list_t.append(m)\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)', '\nN = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\n\nlist_a = []\na = 1\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 1\nlist_a.append(a)\n\n\nnewlist_a = sorted(list_a,reverse=True)\n\n\nn = newlist_a.count(newlist_a[0])\n\nlist_ans = []\nif n == 1:\n\n t = list_a.index(newlist_a[0])\n\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n\n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_A.remove(newlist_a[i])\n list_t.append(list_A.index(newlist_a[i])+i+1)\n \n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n if newlist_a[0]==1:\n list_ans.append(list_S[m])\n else:\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nprint(list_S)\n\n\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 0\nlist_a.append(a)\n\n\n\nnewlist_a = sorted(list_a,reverse=True)\n\nn = newlist_a.count(newlist_a[0])\nlist_ans = []\nif n == 1:\n\n t = list_a.index(newlist_a[0])\n\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n\n list_t = []\n list_t.append(list_a.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_a.remove(newlist_a[i])\n list_t.append(list_a.index(newlist_a[i])+1)\n\n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 0\nlist_a.append(a)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nlist_ans = []\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_A.remove(newlist_a[i])\n list_t.append(list_A.index(newlist_a[i])+i+1)\n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n if newlist_a[0]==0:\n list_ans.append(list_S[m])\n else:\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)', 'S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n if N == 1:\n ans = list_S[t]\n else:\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n a = 0\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[a]]\n ans += "\\n"\n a += 1\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n if N == 1:\n ans = list_S[t]\n else:\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n for i,x in enumerate(list_a):\n if x == newlist_a[0]:\n list_t.append(sum(list_a[0:i]))\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nwhile a < N :\n list_a.append(list_S.count(list_S[a]))\n a += list_S.count(list_S[a])\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nans = ""\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n ans = list_S[t+1]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_t = []\n for i in range(n):\n b = list_a.index(newlist_a[0],i)\n m = 0\n for j in range(b):\n m += list_a[j]\n list_t.append(m)\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nwhile a < N :\n list_a.append(list_S.count(list_S[a]))\n a += list_S.count(list_S[a])\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\n\nans = ""\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n ans +=list_S[m+t]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(n-1):\n list_A.remove(newlist_a[i])\n m = 0\n for j in range(list_A.index(newlist_a[i])+i+1):\n m += list_a[j]\n list_t.append(m)\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\n\nlist_S.sort()\n\nlist_a = []\na = 0\nwhile a < N :\n list_a.append(list_S.count(list_S[a]))\n a += list_S.count(list_S[a])\n\nnewlist_a = sorted(list_a,reverse=True)\n\nn = newlist_a.count(newlist_a[0])\nans = ""\n\nif n == 1:\n t = 0\n for i in range(list_a.index(newlist_a[0])):\n t += list_a[i]\n ans = list_S[t+1]\nelse:\n\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]+"\\n"\n else: \n\n list_t = []\n for i in range(n):\n m = 0\n for j in range(list_a.index(newlist_a[0],i+1)): \n m += list_a[j]\n list_t.append(m)\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]+"\\n"\nprint(ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nprint(list_S)\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a)\n a = 0\nlist_a.append(a)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\nlist_ans = []\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n list_ans.append(list_S[m+t])\nelse:\n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(newlist_a.count(newlist_a[0])-1):\n list_A.remove(newlist_a[i])\n list_t.append(list_A.index(newlist_a[i])+i+1) \n for i in range(len(list_t)):\n m = 0\n for j in range(list_t[i]):\n m += list_a[j]\n if newlist_a[0]==0:\n list_ans.append(list_S[m])\n else:\n list_ans.append(list_S[m+list_t[i]])\nlist_ans.sort()\nprint(list_ans)\n', 'N = int(input())\nlist_S = [input() for i in range(N) ]\nlist_S.sort()\nlist_a = []\na = 0\nfor i in range(N-1):\n if list_S[i] == list_S[i+1]:\n a += 1\n else:\n list_a.append(a+1)\n a = 0\nlist_a.append(a+1)\nnewlist_a = sorted(list_a,reverse=True)\nn = newlist_a.count(newlist_a[0])\n\nans = ""\nif n == 1:\n t = list_a.index(newlist_a[0])\n m = 0\n for i in range(t):\n m += list_a[i]\n ans +=list_S[m+t]\nelse:\n if newlist_a[0]==1:\n for i in range(len(list_S)):\n ans += list_S[i]\n ans += "\\n"\n else: \n list_A = []\n for i in range(len(list_a)):\n list_A.append(list_a[i])\n list_t = []\n list_t.append(list_A.index(newlist_a[0]))\n for i in range(n-1):\n list_A.remove(newlist_a[i])\n m = 0\n for j in range(list_A.index(newlist_a[i])+i+1):\n m += list_a[j]\n list_t.append(m)\n for i in range(len(list_t)):\n ans += list_S[list_t[i]]\n ans += "\\n"\nprint(ans)\n', 'import collections\n\nN = int(input())\nS = [input() for i in range(N)]\nc =collections.Counter(S)\nC = c.most_common()\nlist_C = []\nfor i in range(len(c)):\n list_C.append(C[i][1])\nm = 1\nfor i in range(len(list_C)-1):\n if list_C[i]==list_C[i+1]:\n m += 1\n else:\n break\nans= []\nfor i in range(m):\n ans.append(C[i][0])\nans = sorted(ans)\nfor i in range(len(ans)):\n print(ans[i])'] | ['Runtime Error', 'Time Limit Exceeded', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s027224554', 's064157222', 's141261645', 's278398289', 's304998251', 's324544197', 's338545356', 's376396509', 's479556218', 's540989991', 's594864981', 's618277137', 's641086688', 's660970120', 's701890493', 's710243100', 's782259646', 's937249960', 's950429654', 's031563589'] | [17796.0, 25788.0, 20440.0, 25672.0, 25688.0, 23008.0, 17800.0, 23608.0, 26172.0, 22996.0, 25040.0, 24624.0, 3064.0, 25688.0, 17796.0, 17800.0, 17800.0, 25040.0, 25684.0, 50740.0] | [2105.0, 2105.0, 2105.0, 565.0, 2105.0, 2105.0, 2105.0, 2105.0, 2108.0, 2105.0, 2105.0, 2109.0, 18.0, 538.0, 2104.0, 2104.0, 2104.0, 2105.0, 2105.0, 848.0] | [738, 873, 843, 839, 846, 1097, 764, 1018, 1008, 1433, 1191, 1008, 853, 837, 826, 1007, 1197, 1029, 1056, 397] |
p02773 | u869917163 | 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.append(str(input())) \nc=collections.Counter(S)\nc_sorted=c.most_common()\ns=max(c.values())\nfor i in c_sorted:\n if i[1]==s:\n print(i[0])', 'import collections\nN=int(input())\nS=[]\nfor i in range(N):\n S.append(str(input())) \nc=collections.Counter(S)\nc_sorted=sorted(c.items())\ns=max(c.values())\nfor i in c_sorted:\n if i[1]==s:\n print(i[0])'] | ['Wrong Answer', 'Accepted'] | ['s953131174', 's450156978'] | [46888.0, 46080.0] | [593.0, 1025.0] | [207, 209] |
p02773 | u870684607 | 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())\narr = []\narr_max = []\nfor i in range(N):\n arr.append(input())\ndic = Counter(arr)\ninverse = [(value, key) for key, value in dic.items()]\nmax_s = max(inverse)[0]\nfor key,value in dic.items():\n if value == max_s: \n arr_max.append(key)\n else: continue\nfor j in arr_max: print (j)', 'from collections import Counter\nN = int(input())\narr = []\narr_max = []\nfor i in range(N):\n arr.append(input())\ndic = Counter(arr)\ninverse = [(value, key) for key, value in dic.items()]\nmax_s = max(inverse)[0]\nfor key,value in dic.items():\n if value == max_s: \n arr_max.append(key)\n else: continue\nfor j in sorted(arr_max): print (j)'] | ['Wrong Answer', 'Accepted'] | ['s270654885', 's737024116'] | [47072.0, 49228.0] | [588.0, 789.0] | [340, 348] |
p02773 | u871352270 | 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 i in range(n)]\nc = collections.Counter(S)\nli = c.most_common()\nM = li[0][1]\nfor x in li:\n if x[1] == M:\n print(x[0])\n else:\n break', 'import collections\nn = int(input())\nS = [input() for i in range(n)]\nc = collections.Counter(S)\nli = c.most_common()\nM = li[0][1]\nans = []\nfor x in li:\n if x[1] == M:\n ans.append(x[0])\n else:\n break\nans.sort()\nfor x in ans:\n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s641930158', 's716222877'] | [46872.0, 47636.0] | [522.0, 694.0] | [203, 255] |
p02773 | u871934301 | 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().split() for i in range(N)]\nA=[]\nL=len(S)\nwhile L>0:\n S=[s for s in S if s!=S[0]]\n A.append(L-len(S))\nprint(max(A))\n\n\n', 'N=int(input())\nP=[input().split() for i in range(N)]\nprint(c.most_common(P))', 'n = int(input())\ns = [input() for _ in range(n)]\nd = {}\nfor w in s:\n if w not in d:\n d[w] = 0\n d[w] += 1\nd2 = sorted(d.items(), key=lambda x:x[1], reverse=True)\nmaxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]\nmaxcnts.sort()\nfor ans in maxcnts:\n print(ans)'] | ['Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s049392950', 's126022190', 's479230029'] | [225348.0, 51552.0, 47352.0] | [2118.0, 407.0, 694.0] | [149, 76, 272] |
p02773 | u873134970 | 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\nimport collections\nN=int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = collections.Counter(ss)\nd_=c.most_common()\nd_.sort()\n#print(d_)\nmx = d_[0][1]\nm=len(d_)\nfor i in range(m):\n if d_[i][1] == mx:\n print(d_[i][0])\n else:\n break', 'from collections import defaultdict\nimport collections\nN=int(input())\nss = []\nfor i in range(N):\n ss.append(input())\n\nc = collections.Counter(ss)\nd_=c.most_common()\nmx = d_[0][1]\nd_.sort()\n#print(d_)\nm=len(d_)\nfor i in range(m):\n if d_[i][1] == mx:\n print(d_[i][0])\n else:\n pass'] | ['Wrong Answer', 'Accepted'] | ['s571001045', 's264515217'] | [46872.0, 46904.0] | [953.0, 981.0] | [315, 314] |
p02773 | u873616440 | 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\nimport numpy as np\nN = int(input())\nS = [input() for _ in range(N)]\nc = Counter(S)\ncandidate = np.array(list(c.keys()))[np.array(list(c.values())) == max(c.values())]\nfor i in range(len(candidate)):\n print(candidate[i])', 'from collections import Counter\nimport numpy as np\nN = int(input())\nS = [input() for _ in range(N)]\nc = Counter(S)\ncandidate = sorted(np.array(list(c.keys()))[np.array(list(c.values())) == max(c.values())])\nfor i in range(len(candidate)):\n print(candidate[i])'] | ['Wrong Answer', 'Accepted'] | ['s169206997', 's112756153'] | [64192.0, 79236.0] | [811.0, 1037.0] | [252, 260] |
p02773 | u874644572 | 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 = dict()\n\nfor i in range(n): \n s = input()\n a.setdefault(s, 0)\n a[s] += 1\n \nans = []\nmx = 0\nfor key, value in a.items(): \n if mx < value:\n mx = value\n ans = [key]\n elif mx == value:\n ans.append(key)\n\nfor i in ans:\n print(i)', 'from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\nmc = Counter(s).most_common()\nans = [i[0] for i in mc if i[1] == mc[0][1]]\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s061300344', 's944191437'] | [32096.0, 45040.0] | [579.0, 657.0] | [326, 193] |
p02773 | u875541136 | 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)]\nv, c = zip(*collections.Counter(S).most_common())\nn = c.count(c[0])\nprint('\\n'.join(v[:n]))", "import collections\nN = int(input())\nS = [input() for _ in range(N)]\nv, c = zip(*collections.Counter(S).most_common())\nn = c.count(c[0])\nprint('\\n'.join(sorted(v)[:n]))", "import collections\nN = int(input())\nS = [input() for _ in range(N)]\ncount = collections.Counter(S)\nmaxV = max(count.values())\nc = [k for k, v in count.items() if v == maxV]\nprint('\\n'.join(c))", "import collections\nN = int(input())\nS = [input() for _ in range(N)]\ncount = collections.Counter(S)\nmaxV = max(count.values())\nc = [k for k, v in count.items() if v == maxV]\nprint('\\n'.join(sorted(c)))"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s127447238', 's250892668', 's477970349', 's092579852'] | [47212.0, 47212.0, 35952.0, 35952.0] | [486.0, 681.0, 362.0, 512.0] | [159, 167, 192, 200] |
p02773 | u875600867 | 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 _ in range(N):\n tmp = input()\n try:\n if s[tmp]:\n s[tmp] +=1\n except:\n s[tmp] = 1\n \n#print(s)\nmax_kv_list = [kv[0] for kv in s.items() if kv[1] == max(s.values())]\n#print(max_kv_list)\n\nfor tmp in max_kv_list:\n print(tmp)', 'import collections\nimport itertools\n\n\nN = int(input())\n\ns = []\nfor _ in range(N):\n s.append(input())\n\ncounter = collections.Counter(s)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\n\nl_it=list(it)\nl_it.sort()\nfor k, v in l_it:\n print(k)'] | ['Wrong Answer', 'Accepted'] | ['s915977225', 's227243941'] | [32096.0, 46904.0] | [2104.0, 1064.0] | [310, 338] |
p02773 | u876295560 | 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())\nlist1=[]\nfor i in range(N) :\n list1.append(input())\n\nvariety_list=dict(collections.Counter(list1).most_common())\nprint(variety_list)\nkey_list=list(variety_list.keys())\nvalue_list=list(variety_list.values())\nlist2=[]\n\n\nfor i in range(len(value_list)) :\n if i==0 :\n list2.append(key_list[i])\n elif value_list[0]==value_list[i] :\n list2.append(key_list[i])\n else :\n break\n\nlist2.sort()\nfor item in list2 :\n print(item)\n\n', 'import collections\nN=int(input())\nlist1=[]\nfor i in range(N) :\n list1.append(i)\n\nvariety_list=collections.Counter(list1).most_common()\nkey_list=variety_list.keys()\nvalue_list=variety_list.values()\nlist2=[]\nfor i in range(len(value_list)) :\n if i==0 :\n list2.append(key_list[i])\n elif value_list[0]==value_list[i] :\n list2.append(key_list[i])\n else :\n break\n \nlist2.sort()\nfor item in list2 :\n print(list2)', 'import collections\nN=int(input())\nlist1=[]\nfor i in range(N) :\n list1.append(input())\nc=collections.Counter(list1)\n\n\nkey_list=list(c.keys())\nvalue_list=list(c.values())\nlist2=[]\n\ncurerent=0\nk=max(value_list)\nfor i,item in enumerate(key_list) :\n if value_list[i]==k :\n list2.append(item)\n \n\nlist2.sort()\nfor item in list2 :\n print(item)\n\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s320596363', 's413205713', 's802855368'] | [55788.0, 39276.0, 36464.0] | [871.0, 118.0, 674.0] | [465, 422, 344] |
p02773 | u877428733 | 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())\nlist_1 = [input() for i in range(N)]\nlist_2 = collections.Counter(list_1)\n\nfor i in list_2:\n print(i)\n\nm = max(list_2.values())\n\nans = [k for k in list_2 if list_2[k] == m]\n\nfor l in sorted(ans):\n print(l)', 'import collections\n\nN = int(input())\nlist_1 = [input() for i in range(N)]\nlist_2 = collections.Counter(list_1)\n\nm = max(list_2.values())\n\nans = [k for k in list_2 if list_2[k] == m]\n\nfor l in sorted(ans):\n print(l)\n'] | ['Wrong Answer', 'Accepted'] | ['s302021717', 's965402569'] | [36588.0, 35572.0] | [739.0, 622.0] | [249, 218] |
p02773 | u878239774 | 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())\ndata_list = [input() for i in range(n)]\ndata_list.sort()\n\n\ndata_set = set(data_list)\nsorted_list = sorted(data_set)\n\ncount_list = [0] * len(sorted_list)\n\nfor i in range(len(sorted_list)):\n for j in range(len(data_list)):\n if sorted_list[i] == data_list[j]:\n count_list[i] +=1\n\nmax_indexes = [i for i, x in enumerate(count_list) if x == max(count_list)]\n\nfor i in range(len(max_indexes)):\n print(sorted_list[i])', 'n = int(input())\ndata_list = [input() for i in range(n)]\ndata_list.sort()\n\ncount_dict = collections.Counter(data_list)\n\nmax_val = max(count_dict.values())\nmax_keys = [key for key in count_dict if count_dict[key] == max_val]\n\nfor i in range(len(max_keys)):\n print(max_keys[i])', 'import collections\n\nn = int(input())\ndata_list = [input() for i in range(n)]\ndata_list.sort()\n\ncount_dict = collections.Counter(data_list)\n\nmax_val = max(count_dict.values())\nmax_keys = [key for key in count_dict if count_dict[key] == max_val]\n\nmax_keys.sort()\n\nfor i in range(len(max_keys)):\n print(max_keys[i])'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s268727090', 's935653381', 's105376649'] | [29628.0, 17800.0, 35572.0] | [2105.0, 449.0, 891.0] | [451, 278, 315] |
p02773 | u878654696 | 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. | ["class Counter(dict):\n def __missing__(self, i):\n return 0\n\nn = int(input())\n\ns = Counter()\n\nfor _ in range(n):\n i = input()\n s[i] += 1\n\ns = dict(sorted(s.items(), key=lambda x: -x[1]))\nm = list(s.values())[0]\n\nans = []\nfor i in s:\n if s[i] == m:\n ans.append(i)\n\nprint('\\n'.join(ans))\n", 'if (n := int(input())) > 0:\n for _ in range(n):\n input()', "class Counter(dict):\n def __missing__(self, i):\n return 0\n\nn = int(input())\n\ns = Counter()\n\nfor _ in range(n):\n i = input()\n s[i] += 1\n\ns = dict(sorted(s.items(), key=lambda x: x[1]))\nm = s.values()[0]\n\nans = []\nfor i in s:\n if s[i] == m:\n ans.append(i)\n\nprint('\\n'.join(ans))", "class Counter(dict):\n def __missing__(self, i):\n return 0\n\nn = int(input())\n\ns = Counter()\n\nfor _ in range(n):\n i = input()\n s[i] += 1\n\ns = list(sorted(s.items(), key=lambda x: -x[1]))\nm = s[0][1]\n\nans = []\nfor key, value in s:\n if value == m:\n ans.append(key)\n else:\n break\n\nans.sort()\n\nprint('\\n'.join(ans))\n"] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s122918237', 's189049338', 's981671971', 's246935333'] | [66140.0, 2940.0, 66268.0, 43228.0] | [627.0, 17.0, 556.0, 737.0] | [294, 60, 286, 324] |
p02773 | u880850253 | 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. | [' \ndic = {}\nm = 0\n\nfor i in L:\n if i in dic:\n dic[i] = dic[i] + 1\n else:\n dic[i] = 1\n \n if m < dic[i]:\n m = dic[i]\n\nn = []\nfor i in dic:\n if dic[i] == m:\n n.append(i)\nn.sort()\nfor i in n:\n print(i)', '\nN = int(input())\nL = [ input() for i in range(N)]\n#print(L)\n \ndic = {}\nm = 0\n\nfor i in L:\n if i in dic:\n dic[i] = dic[i] + 1\n else:\n dic[i] = 1\n \n if m < dic[i]:\n m = dic[i]\n\nn = []\nfor i in dic:\n if dic[i] == m:\n n.append(i)\nn.sort()\nfor i in n:\n print(i)\n'] | ['Runtime Error', 'Accepted'] | ['s249241658', 's405907955'] | [3064.0, 35216.0] | [17.0, 689.0] | [249, 311] |
p02773 | u885630173 | 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())\ndic = {}\nfor i in range(N):\n s = str(input())\n if dic.get(s):\n dic[s] += 1\n else:\n dic[s] = 1\n\nmax_k_list = [kv[0] for kv in dic.items() if kv[1] == max(dic.values())]\ns_n = '\\n'.join(max_k_list)\nprint(s_n)", 'N = int(input())\ndic = {}\nnmax = 1\nfor i in range(N):\n s = str(input())\n if s in dic:\n dic[s] += 1\n \n nmax = max(dic[s], nmax)\n else:\n dic[s] = 1\nslist = []\nfor k in dic:\n if dic[k] == nmax:\n slist.append(k)\nfor s in sorted(slist):\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s099027418', 's848149622'] | [32476.0, 32988.0] | [2105.0, 676.0] | [252, 307] |
p02773 | u888881904 | 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)]\n\ns = collections.Counter(s)\n\nmax_kv = [kv for kv in s.items() if kv[1] == max(s.values())]\n\nfor i in max_kv:\n print(i[0])', 'import collections\nn = int(input())\ns = [input() for _ in range(n)]\n\ns = collections.Counter(s).most_common()\nmx = s[0][1]\n\nans = []\nfor k, v in s:\n if mx == v:\n ans.append(k)\n\n\nfor i in sorted(ans):\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s918501404', 's328881914'] | [35576.0, 45036.0] | [2105.0, 724.0] | [192, 222] |
p02773 | u891884439 | 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())\npoll = {}\nfor i in range(N):\n S = input()\n if S in poll:\n poll[S] = poll[S] + 1\n else:\n poll[S] = 1\n \na = [k for k, v in poll.items() if v == max(poll.values())]\n\nfor el in a:\n print(el)', 'N = int(input())\npoll = {}\nfor i in range(N):\n S = input()\n if S in poll:\n poll[S] = poll[S] + 1\n else:\n poll[S] = 1\n\nmaxv = max(poll.values())\na = [k for k, v in poll.items() if v == maxv]\na.sort()\n\nfor el in a:\n print(el)'] | ['Wrong Answer', 'Accepted'] | ['s278516896', 's312514542'] | [32096.0, 32096.0] | [2104.0, 691.0] | [236, 249] |
p02773 | u891945807 | 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().rstrip())\ndict = {}\n\ndef in_dict(key):\n if key in dict.keys():\n dict[key] += 1\n else:\n dict[key] = 1\n \n\nfor n in range(1,N):\n in_dict(input().rstrip())\n \nmax_val = max(dict.values())\nkeys_max = [key for key in dict if dict[key] == max_val]\n\nkeys_max = sorted(keys_max)\n\nfor res in keys_max:\n print(res)\n ', 'n = int(input())\n\ns = []\nfor i in range(n):\n s.append(input())\n \ns.sort()\n\nprint(s)\nt =[]\ncount = 1\nfor i in range(1,n):\n if s[i-1] == s[i] and i != n-1:\n count+=1\n elif s[i-1] == s[i] and i == n-1:\n count += 1\n t.append([s[i-1],count])\n elif i == n-1:\n t.append([s[i-1],1])\n else:\n t.append([s[i-1],count])\n count = 1\n\nt.sort(key=lambda x:x[1])\n\nfor j in range(len(t)-1,0,-1):\n if t[j][1] != t[j-1][1]:\n k = j\n break\nfor b in range(k,len(t)):\n print(t[b][0])', 'n = int(input())\n\ns = []\nfor i in range(n):\n s.append(input())\n \ns.sort()\nt =[]\ncount = 1\nfor i in range(1,n):\n if s[i-1] == s[i] and i != n-1:\n count+=1\n elif s[i-1] == s[i] and i == n-1:\n count += 1\n t.append([s[i-1],count])\n elif i == n-1:\n t.append([s[i-1],1])\n t.append([s[i],1])\n \n else:\n t.append([s[i-1],count])\n count = 1\n\nt.sort(key=lambda x:x[1])\nma = t[len(t)-1][1]\n\nfor i in range(len(t)):\n if t[i][1] == ma:\n print(t[i][0])\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s750132149', 's894947479', 's444059721'] | [32988.0, 42028.0, 39084.0] | [701.0, 753.0, 850.0] | [332, 491, 472] |
p02773 | u896741788 | 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)]\nfrom collections import Counter as co\nk=co(l).most_common()\nd=k[0][1]\nfor a,s in k:\n if s!=d:break\n else:\n print(a)', 'n=int(input())\nl=[input() for i in range(n)]\nfrom collections import Counter as co\nk=co(l).most_common()\nd=k[0][1]\nprint(*sorted([a for a,s in k if s==d]),sep="\\n")'] | ['Wrong Answer', 'Accepted'] | ['s951526681', 's194482736'] | [45072.0, 45072.0] | [502.0, 844.0] | [167, 164] |
p02773 | u898058223 | 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 i in range(N)]\nS=sorted(S)\nC=collections.Counter(S).most_common()\nfor i in range(len(C)):\n print(C[i][0])', 'from statistics import mode\n\nN=int(input())\nS=[input() for i in range(N)]\nS=sorted(S)\nprint(mode(S))', 'n=int(input())\ns=[input() for i in range(n)]\ns.sort()\nb=list(set(s))\nb.sort()\na=s[0]\nm=[0]\nfor i in range(n):\n if s[i]!=a:\n m.append(i)\n a=s[i]\nm.append(n)\no=[]\nfor i in range(len(m)-1):\n o.append(m[i+1]-m[i])\nnum=max(o)\nfor i in range(len(o)):\n if o[i]==num:\n print(b[i])'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s104136554', 's646967488', 's472011549'] | [45316.0, 47016.0, 30256.0] | [810.0, 618.0, 918.0] | [155, 100, 284] |
p02773 | u909851424 | 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 = {}\n\nfor i in range(N):\n arg = input()\n if (arg in S):\n S[arg] = S[arg] + 1\n else:\n S[arg] = 1\nvalSorted = sorted(S.items(), key=lambda x:(-x[1], x[0]))\nbreakKey = None\nfor key, value in valSorted:\n if breakKey is None:\n breakKey = value\n if breakKey != value:\n break\n print(str(key)', 'N = int(input())\nS = {}\n\nfor i in range(N):\n arg = input()\n if (arg in S):\n S[arg] = S[arg] + 1\n else:\n S[arg] = 1\n\nbreakKey = None\nfor key, value in valSorted:\n if breakKey is None:\n breakKey = value\n if breakKey != value:\n break\n print(str(key))', 'N = int(input())\nS = {}\n\nfor i in range(N):\n arg = input()\n if (arg in S):\n S[arg] = S[arg] + 1\n else:\n S[arg] = 1\nvalSorted = sorted(S.items(), key=lambda x:(-x[1], x[0]))\nbreakKey = -1\nfor key, value in valSorted:\n if breakKey == -1:\n breakKey = value\n if breakKey != value:\n break\n print(str(key))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s705589776', 's771773925', 's717692572'] | [3064.0, 32224.0, 59228.0] | [17.0, 364.0, 1054.0] | [349, 352, 346] |
p02773 | u912245812 | 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())\narr = list(map(str,input().split()))\ncnt, mx = Counter(), -1\nfor i in arr:\n cnt[i] += 1\n mx = max(mx,cnt[i])\nres = []\nfor i in arr:\n if cnt[i] == mx:\n res.append(i)\nres.sort()\nprint(res[0])', 'from collections import Counter\nn, cnt, mx, arr = int(input()), Counter(), -1, []\nfor i in range(n):\n s = input()\n arr.append(s)\n cnt[s] += 1\n mx = max(mx,cnt[s])\nres = []\nfor i in arr:\n if cnt[i] == mx:\n res.append(i)\nres.sort()\nfor i in res:\n print(i)', 'from collections import Counter\nn, cnt, mx, arr = int(input()), Counter(), -1, []\nfor i in range(n):\n s = input()\n arr.append(s)\n cnt[s] += 1\n mx = max(mx,cnt[s])\nres = []\nfor i in arr:\n if cnt[i] == mx:\n res.append(i)\n cnt[i] = 0\nres.sort()\nfor i in res:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s351416438', 's491122471', 's261876769'] | [3316.0, 33748.0, 33740.0] | [20.0, 956.0, 1024.0] | [254, 278, 297] |
p02773 | u917558625 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nimport itertools\ns=int(input())\nl=[input() for i in range(s)]\ncounter = collections.Counter(l)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\nu=[]\nfor k, v in it:\n u.append(k)\nu.sort\nfor i in range(len(u)):\n print(u[i])', 'import collections\nimport itertools\ns=int(input())\nl=[input() for i in range(s)]\ncounter = collections.Counter(l)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\nu=[]\nfor k, v in it:\n u.append(k)\nu.sort\nprint(*u)', 'import collections\nimport itertools\ns=int(input())\nl=[input() for i in range(s)]\ncounter = collections.Counter(l)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\nu=[]\nfor k, v in it:\n u.append(k)\n \nu.sort()\nfor i in range(len(u)):\n print(u[i])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s166051331', 's612269778', 's895570570'] | [45040.0, 45040.0, 45120.0] | [720.0, 620.0, 837.0] | [315, 287, 320] |
p02773 | u919235786 | 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=0\ns=[]\nfor i in range(n):\n si=input()\n s.append(si)\n li=len(si)\n l=max(l,li)\nans=[]\nfor i in range(n):\n if len(s[i])==l:\n ans.append(s[i])\n\nans.sort()\nfor i in ans:\n print(i)', 'n=int(input())\ns=dict()\nfor i in range(n):\n si=input()\n if si in s:\n s[si]+=1\n else:\n s[si]=0\nl=max(s.values())\nans=[]\nfor i in s:\n if s[i]==l:\n ans.append(i)\nans.sort()\nprint(ans)', 'n=int(input())\ns=dict()\nfor i in range(n):\n si=input()\n if si in s:\n s[si]+=1\n else:\n s[si]=0\nl=max(s.values())\nans=[]\nfor i in s:\n if s[i]==l:\n ans.append(i)\nans.sort()\nfor i in ans:\n print(i)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s341817425', 's913383964', 's320759754'] | [24752.0, 38000.0, 35360.0] | [397.0, 422.0, 473.0] | [216, 213, 229] |
p02773 | u920340928 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['N = int(input())\nd = {}\nfor i in range(N):\n s = input()\n if s not in d:\n d[s] = 1\n else:\n d[s] += 1\n\nprint(d)\n\nlist = sorted(d.values())\nprint(list)\nmax_value = max(list)\nsorted_list = sorted(d.items(), key=lambda x: x[0])\nprint(sorted_list)\n\nfor i, j in sorted_list:\n if j == max_value:\n print(i)', 'N = int(input())\nd = {}\nfor i in range(N):\n s = input()\n if s not in d:\n d[s] = 1\n else:\n d[s] += 1\n\nlist = sorted(d.values())\nmax_value = max(list)\nsorted_list = sorted(d.items(), key=lambda x: x[0])\n\nfor i, j in sorted_list:\n if j == max_value:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s704305398', 's913894322'] | [62044.0, 48092.0] | [882.0, 800.0] | [330, 289] |
p02773 | u921950806 | 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\nimport collections\n\nn = int(input())\ns = [input() for i in range(n)]\n\ncounted = collections.Counter(s)\n\nm = max(counted.values())\n\nchars = [key for key, value in counted.items()\n if value == m]\nmoji = '\\n'.join(chars)\n\nprint(moji)", "import collections\n\nn = int(input())\ns = [input() for i in range(n)]\n\ncounted = collections.Counter(s)\n\nm = max(counted.values())\n\nchars = [key for key, value in counted.items()\n if value == m]\nchars.sort()\n\nmoji = '\\n'.join(chars)\n\nprint(moji)"] | ['Wrong Answer', 'Accepted'] | ['s612575765', 's241815459'] | [35952.0, 35952.0] | [362.0, 621.0] | [264, 256] |
p02773 | u923270446 | 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 = dict()\ns = [input() for i in range(n)]\nl = []\nfor i in set(s):\n d[i] = 0\nfor i in s:\n d[i] += 1\nprint(d.items())\nl = [k for k, v in d.items() if v == max(d.values())]\nl.sort()\nprint(*l, sep="\\n")', 'from collections import Counter\nn = int(input())\ns = [input() for i in range(n)]\nc = Counter(s)\nm = c.most_common()[0][1]\nl = []\nfor i in c.keys():\n if c[i] == m:\n l.append(i)\nl.sort()\nprint(*l, sep="\\n")'] | ['Wrong Answer', 'Accepted'] | ['s118803121', 's106236364'] | [50816.0, 45040.0] | [2105.0, 712.0] | [222, 214] |
p02773 | u924783770 | 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())\nS.sort()\nS.reverse()\nprint(S)\nans=[]\nwhile len(S):\n if len(S)==1:\n x = [S.pop(0), 1]\n ans.append(x)\n break\n x = [S.pop(0), 1]\n for i in S[:]:\n if x[0] == i:\n S.remove(i)\n x[1]+=1\n ans.append(x)\n\nans.sort(key=lambda x:x[1])\nans.reverse()\nfor i in range(len(ans)):\n t=ans[0][1]\n if ans[i][1]==t:\n print(ans[i][0])\n', '#\nN=int(input())\nS={}\nfor i in range(N):\n x=input()\n if x in S:\n S[x]+=1\n else:\n S[x]=1\nt=max(S.values())\nans=[k for (k,v) in S.items() if v==t]\nans.sort()\n\nfor i in ans:\n print(i)\n""""\n#\nwhile len(S):\n if len(S)==1:\n x = [S.pop(), 1]\n ans.append(x)\n break\n x = [S.pop(), 1]\n for i in S[:]:\n if x[0] == i:\n S.remove(i)\n x[1]+=1\n ans.append(x)\nans.sort()\nans.sort(key=lambda x:x[1],reverse=True)\n\nfor i in range(len(ans)):\n t=ans[0][1]\n if ans[i][1]==t:\n print(ans[i][0])\n\n\n\nimport queue\n\nq=queue.Queue()\nfor i in S:\n q.put(i)\n\nwhile not q.empty():\n x = [q.get(), 1]\n if len(ans)==0:\n ans.append(x)\n continue\n t=0\n for i in range(len(ans)):\n if x[0] == ans[i][0]:\n ans[i][1]+=1\n t+=1\n break\n if t==0:\n ans.append(x)\nans.sort()\nans.sort(key=lambda x:x[1],reverse=True)\n\nfor i in range(len(ans)):\n t=ans[0][1]\n if ans[i][1]==t:\n print(ans[i][0])\n\n"""'] | ['Wrong Answer', 'Accepted'] | ['s934707884', 's601272915'] | [25028.0, 32096.0] | [2105.0, 627.0] | [448, 1040] |
p02773 | u931462344 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['from collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\nClist = Counter(S).most_common()\nnum = Clist[0][1]\nanses = [Clist[0][0]]\nfor X in Clist[1:]:\n if X[1] == num:\n anses.append(X[0])\n\nfor ans in anses:\n print(ans)', 'from collections import Counter\n\nN = int(input())\nS = [input() for _ in range(N)]\nClist = Counter(S).most_common()\nnum = Clist[0][1]\nanses = [Clist[0][0]]\nfor X in Clist[1:]:\n if X[1] == num:\n anses.append(X[0])\nanses.sort()\nfor ans in anses:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s873953250', 's984431293'] | [45036.0, 45040.0] | [534.0, 687.0] | [255, 267] |
p02773 | u932370518 | 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\nif __name__ == "__main__":\n N = int(input())\n S = []\n for i in range(N):\n S.append(input())\n S_collect = collections.Counter(S)\n S_tp = []\n for word in S_collect.most_common():\n S_tp.append(word)\n for i in S_tp:\n if i[1] == S_tp[0][1]:\n print(i[0])\n else:\n exit()\n', 'import collections\n\nif __name__ == "__main__":\n N = int(input())\n S = []\n for i in range(N):\n S.append(input())\n S_collect = collections.Counter(S)\n S_tp = []\n for word in S_collect.most_common():\n S_tp.append(word)\n S_tp_sort = []\n for i in S_tp:\n if i[1] == S_tp[0][1]:\n S_tp_sort.append(i[0])\n else:\n break\n S_tp_sort = sorted(S_tp_sort)\n for s in S_tp_sort:\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s562375455', 's811825349'] | [46860.0, 49332.0] | [594.0, 795.0] | [356, 458] |
p02773 | u932868243 | 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)]\nl=list(set(s))\ncnt=[0]*len(l)\nfor ss in l:\n for sss in s:\n if sss==ss:\n cnt[l.index(ss)]+=1\nm=max(cnt)\nans=[]\nfor cc in cnt:\n if cc==m:\n ans.append(cnt.index(cc))\nfor aa in ans:\n print(l[aa])', 'n=int(input())\ns=[input() for x in range(n)]\nl=list(set(s))\nl.sort()\ncnt=[0]*len(l)\nfor ss in s:\n cnt[l.index(ss)]+=1\nm=max(cnt)\nans=[]\nfor cc in cnt:\n if cc==m:\n ans.append(cnt.index(cc))\nfor aa in ans:\n print(l[aa])\nprint(ans)\nprint(cnt)\nprint(l)', 'n=int(input())\ns=[input() for x in range(n)]\nl=list(set(s))\nl.sort()\ncnt=[0]*len(l)\nfor ss in s:\n cnt[l.index(ss)]+=1\nm=max(cnt)\nans=[]\nfor cc in cnt:\n if cc==m:\n ans.append(cnt.index(cc))\nfor aa in ans:\n print(l[aa])\n', 'n=int(input())\ns=[input() for x in range(n)]\nl=list(set(s))\nl.sort()\ncnt=[0]*len(l)\nfor ss in s:\n cnt[l.index[ss]]+=1\nm=max(cnt)\nans=[]\nfor cc in cnt:\n if cc==m:\n ans.append(cnt.index(cc))\nfor aa in ans:\n print(l[aa])', 'import collections\nn=int(input())\ns=[input() for _ in range(n)]\nc=collections.counter(s)\ncommon=c.most_common()\nvalue,cnt=zip(*common)\ncommon.sort(key=lambda x:x[0])\nm=max(cnt)\nfor cc in most_common:\n if cc[1]==max:\n print(cc[0])', 'import collections\nn=int(input())\ns=[input() for _ in range(n)]\nc=collections.Counter(s)\ncommon=c.most_common()\nvalue,cnt=zip(*common)\ncommon.sort(key=lambda x:x[0])\nm=max(cnt)\nfor cc in common:\n if cc[1]==m:\n print(cc[0])\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s024381409', 's205818183', 's297466604', 's297649496', 's882515909', 's858873817'] | [29076.0, 29076.0, 29076.0, 29076.0, 17408.0, 60912.0] | [2105.0, 2105.0, 2105.0, 471.0, 265.0, 818.0] | [250, 254, 224, 223, 233, 227] |
p02773 | u933129390 | 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\n\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\n\ndic = collections.Counter(s)\nk = dic.most_common()\nm = k[0][1]\nmx = m\ni = 0\nwhile m == mx: \n print(k[i][0])\n i += 1\n if i > len(k)-1:\n break\n m = k[i][1]\n\n', 'import collections\n\n\nn = int(input())\ns = []\nfor i in range(n):\n s.append(input())\n\ndic = collections.Counter(s)\nk = dic.most_common()\nm = k[0][1]\nmx = m\ni = 0\nans = []\nwhile m == mx: \n ans.append(k[i][0])\n i += 1\n if i > len(k)-1:\n break\n m = k[i][1]\n\nans = sorted(ans)\nfor i in ans:\n print(i)\n'] | ['Wrong Answer', 'Accepted'] | ['s216069760', 's426078811'] | [46928.0, 49240.0] | [608.0, 759.0] | [261, 320] |
p02773 | u934868410 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['n = int(input())\nd = {}\nfor i in range(n):\n s = input()\n d[s] = 1 if not s in d else d[s] += 1\n\nans = []\nc = max(d.values())\nfor k,v in d.items():\n if v == c:\n ans += [k]\nfor x in sorted(ans):\n print(x)', 'n = int(input())\nd = dict()\nfor i in range(n):\n s = input()\n if not s in d:\n d[s] = 1\n else:\n d[s] += 1\n\nans = []\nc = max(d.values())\nfor k, v in d.items():\n if v == c:\n ans += [k]\nfor x in sorted(ans):\n print(x)'] | ['Runtime Error', 'Accepted'] | ['s667079029', 's570376159'] | [2940.0, 32988.0] | [17.0, 638.0] | [209, 248] |
p02773 | u937745164 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['if __name__=="__main__":\n n = int(input())\n s=[]\n for i in range(n):\n s.append(input())\n \n s_most = s.most_common()\n\n print(s_most[0])\n\n for i in range(1,len(s_most)):\n if s_most[i]==s_most[0]:\n print(s_most[i])\n else:\n break', 'from collections import Counter\n\nif __name__=="__main__":\n n = int(input())\n s=[]\n for i in range(n):\n s.append(input())\n \n s_most = Counter(s).most_common()\n\n ans_list = [s_most[0][0]]\n for i in range(1,len(s_most)):\n if s_most[i][1]==s_most[0][1]:\n ans_list.append(s_most[i][0])\n else:\n break\n\n ans_list.sort()\n\n for i in range(len(ans_list)):\n print(ans_list[i])'] | ['Runtime Error', 'Accepted'] | ['s224928913', 's737337631'] | [17048.0, 45040.0] | [276.0, 841.0] | [293, 446] |
p02773 | u939585142 | 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()\ns = set(S)\n\nans = []\nM = 1\ncc = []\nC = True\nfor i in s:\n c = 0\n for j in S:\n if i == j:\n c += 1\n cc.append(c)\n if c == 1 and max(cc) >= M:\n C = None\n if c >= M and C == None:\n M = c\n ans.append(i)\nans.sort()\n\n\nif C == True:\n for i in ans:\n print(i)\nelse:\n for i in S:\n print(i)', 'N = int(input())\nS = [input() for i in range(N)]\nS.sort()\ns = set(S)\n\nans = []\nM = 1\ncc = []\nC = True\nfor i in s:\n c = 0\n for j in S:\n if i == j:\n c += 1\n cc.append(c)\n if c == 1 and max(cc) >= M:\n C = None\n if c >= M and C == None:\n M = c\n ans.append(i)\nans.sort()\n\n\nif C == None:\n for i in ans:\n print(i)\nelse:\n for i in S:\n print(i)', 'import collections\nN = int(input())\nS = [input() for i in range(N)]\nc = collections.Counter(S).most_common()\n\nans = []\nfor i in c:\n if c[0][1] == i[1]:\n ans.append(i[0])\nans.sort()\n\nfor i in ans:\n print(i)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s341182868', 's619434695', 's633269042'] | [29632.0, 29636.0, 45040.0] | [2105.0, 2105.0, 684.0] | [365, 365, 211] |
p02773 | u941644149 | 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())\n#L = []\nL = [input() for _ in range(N)]\n#for n in range(N):\n #S = input()\n #L.append(S)\nDic = Counter(L)\nmax_k_list = [kv[0] for kv in Dic.items() if kv[1] == max(Dic.values())]\nmax_k_list = max_k_list.sort()\nfor t in max_k_list:\n print(t)', 'N = int(input())\nL = []\nDic = {}\nfor n in range(N):\n S = input()\n L.append(S)\nUnique = list(set(L))\n\nfor i in Unique:\n Dic[i]=0\n\nfor j in range(len(L)):\n Dic[j] = Dic[j] + 1\n \nmax_k_list = [kv[0] for kv in Dic.items() if kv[1] == max(Dic.values())]\nmax_k_list = sorted(max_k_list)\nfor t in max_k_list:\n print(t)', 'from collections import Counter\nN = int(input())\nL = [input() for _ in range(N)]\n#for n in range(N):\n #S = input()\n #L.append(S)\nDic = Counter(L)\n\nmax_k_list = [i for i, j in Dic.items() if j == max(Dic.values())]\nmax_k_list = max_k_list.sort()\nfor t in max_k_list:\n print(t)', 'N = int(input())\nDic = {}\nfor n in range(N):\n S = input()\n if S in Dic.keys():\n Dic[S] = Dic[S] + 1\n else:\n Dic[S] = 1\n\nmax_val = max(Dic.values())\nmax_k_list = [kv[0] for kv in Dic.items() if kv[1] == max_val]\nmax_k_list = sorted(max_k_list)\n\n\n \nprint(*max_k_list, sep="\\n") '] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s383319366', 's485380148', 's496551634', 's309411997'] | [35572.0, 42764.0, 35572.0, 34012.0] | [2105.0, 369.0, 2105.0, 638.0] | [297, 329, 284, 474] |
p02773 | u943057856 | 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=dict()\nfor _ in range(n):\n a=input()\n if a in d:\n d[a]+=1\n else:\n d[a]=1\nkeys = sorted([k for k,v in d.items() if v==max(d.values())])\nprint(keys,sep="\\n")', 'n=int(input())\nd=dict()\nfor _ in range(n):\n a=input()\n if a in d:\n d[a]+=1\n else:\n d[a]=1\nm=max(d.values())\nkeys = [k for k,v in d.items() if v==m]\nprint("\\n".join(sorted(keys)))'] | ['Wrong Answer', 'Accepted'] | ['s264285541', 's292204377'] | [32096.0, 34140.0] | [2108.0, 528.0] | [195, 201] |
p02773 | u944325914 | 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())\nstartlist=[]\nfor _ in range(n):\n startlist.append(input())\ndictlist=sorted(startlist)\nsetlist=list(set(dictlist))\ncountlist=[0]*(int(len(setlist)))\ncount=1\ncount2=1\nfor i in range(n):\n if i==n-1:\n countlist[i-count2+1]+=count\n elif dictlist[i+1]==dictlist[i]:\n count+=1\n count2+=1\n else:\n countlist[i-count2+1]+=count\n count=1\nindexlist=[i for i,x in enumerate(countlist) if x==max(countlist)]\nfor j in tuple(sorted(indexlist)):\n print(setlist[j])', 'from collections import Counter\nn=int(input())\na=[]\nfor i in range(n):\n a.append(input())\nac=Counter(a)\nacs=sorted(ac.items(),key=lambda x:x[1],reverse=1)\nz=len(acs)\ni=0\ntemp=[]\n\nwhile i<=z-1 and acs[i][1]==acs[0][1] :\n temp.append(acs[i][0])\n i+=1\ntemp.sort()\nfor i in temp:\n print(i)'] | ['Wrong Answer', 'Accepted'] | ['s556936552', 's009987907'] | [31172.0, 50176.0] | [2105.0, 521.0] | [514, 289] |
p02773 | u944643608 | 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()\nmaxi = 0\nans = []\ntotal_count = 0\nwhile total_count != N:\n tmp = S.count(S[total_count])\n total_count += tmp\n if maxi < tmp:\n maxi = tmp\n ans.clear()\n ans.append(S[total_count])\n elif maxi == tmp:\n ans.append(S[total_count])\nfor i in range(len(ans)):\n print(ans[i])\n \n ', 'N = int(input())\nS = [input() for i in range(N)]\nS.sort()\nmaxi = 0\ntmp = 1\nans = []\nfor i in range(N-1):\n if S[i] == S[i+1]:\n tmp += 1\n else:\n if tmp > maxi:\n maxi = tmp\n ans.clear()\n ans.append(S[i])\n elif tmp == maxi:\n ans.append(S[i])\n tmp = 1\n if i == N-2:\n if S[i] == S[i+1]:\n if tmp > maxi:\n maxi = tmp\n ans.clear()\n ans.append(S[i])\n elif tmp == maxi:\n ans.append(S[i])\n else:\n if maxi == 1:\n ans.append(S[N-1])\nfor i in range(len(ans)):\n print(ans[i])\n'] | ['Runtime Error', 'Accepted'] | ['s037993790', 's855605053'] | [17800.0, 20680.0] | [2104.0, 655.0] | [348, 572] |
p02773 | u945181840 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ["import sys\nfrom collections import Counter\n\nread = sys.stdin.read\n\nN, *S = map(str, read().split())\ns = Counter(S)\nn = max(s.values())\nanswer = [i for i, j in s if j == n]\nanswer.sort()\nprint('\\n'.join(answer))\n", "import sys\nfrom collections import Counter\n\nread = sys.stdin.read\n\nN, *S = map(str, read().split())\ns = Counter(S)\nn = max(s.values())\nanswer = [i for i, j in s.items() if j == n]\nanswer.sort()\nprint('\\n'.join(answer))\n"] | ['Runtime Error', 'Accepted'] | ['s963425667', 's882460988'] | [38520.0, 38520.0] | [102.0, 299.0] | [211, 219] |
p02773 | u947327691 | 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=dict()\n\nfor i in range(n):\n a=input()\n d.setdefault(s,0)\n d[s] += 1\n\nmx=0\nresult=[]\nfor key,value in d.items:\n if mx < value:\n mx = value\n result=[key]\n elif mx == value:\n result.append(key)\n\nresult.sort()\n\nfor i in range(len(result)):\n print(i)', 'n = int(input())\ns= []\n\nfor _ in range(n):\n s.append(input())\n\ns.sort()\nn =set(s)\nn=list(n)\nprint(n)\n\nf = []\n\nfor i in range(len(n)):\n f.append([n[i],s.count(n[i])])\n\nf.sort(reverse=True,key=lambda f:f[1])\n\nmax = f[0][0]\nfl=[]\nfor i in range (len(f)):\n if f[i][1] == max:\n fl.append(f[i][0])\n else:\n break\n\nfl.sort()\nans=(set(fl))\nansf=list(ans)\n\nfor i in range(len(ansf)):\n print(ansf[i])', 'n = int(input())\ns= []\n\nfor _ in range(n):\n s.append(input())\n\ns.sort()\nn =set(s)\nn=list(n)\nprint(n)\n\nf = []\n\nfor i in range(len(n)):\n f.append([n[i],s.count(n[i])])\n\nf.sort(reverse=True,key=lambda f:f[1])\nmax = f[0][1]\nfl=[]\nfor i in range (len(f)):\n if f[i][1] == max:\n fl.append(f[i][0])\n else:\n break\n\nfl.sort()\nans=(set(fl))\nansf=list(ans)\n\nfor i in range(len(ansf)):\n print(ansf[i])', 'n = int(input())\ns= []\n\nfor _ in range(n):\n s.append(input())\n\ns.sort()\nn =set(s)\nn=list(n)\n\nf = []\n\nfor i in range(len(n)):\n f.append([n[i],s.count(n[i])])\n\nf.sort(reverse=True,key=lambda f:f[1])\nmax = f[0][1]\nfl=[]\nfor i in range (len(f)):\n if f[i][1] == max:\n fl.append(f[i][0])\n else:\n break\n\nfl.sort()\nans=(set(fl))\nansf=list(ans)\n\nfor i in range(len(ansf)):\n print(ansf[i])', 'n=int(input())\nd=dict()\n\nfor i in range(n):\n a=input()\n d.setdefault(a,0)\n d[a] += 1\n\nmx=0\nresult=[]\nfor key,value in d.items():\n if mx < value:\n mx = value\n result=[key]\n elif mx == value:\n result.append(key)\n\nresult.sort()\n\nfor i in range(len(result)):\n print(result[i])'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s228412172', 's239165153', 's254388057', 's798873159', 's562351109'] | [3064.0, 29632.0, 29632.0, 29628.0, 32096.0] | [22.0, 2105.0, 2105.0, 2105.0, 724.0] | [277, 418, 417, 408, 287] |
p02773 | u948521599 | 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 x in range(N):\n S.append(input())\nS_label_n = []\nS_label = list(set(S))\nfor x in S_label:\n S_label_n.append(S.count(x))\nmaxIndex = [i for i, x in enumerate(S_label_n) if x == max(S_label_n)]\nans_list = []\nfor x in maxIndex:\n ans_list.append(S_label[x])\nans_list.sort()\nprint(ans_list)', 'import sys\ninput = sys.stdin.readline\nN = int(input())\ndictS = {}\nfor x in range(N):\n tmp = input().rstrip()\n if tmp in dictS:\n dictS[tmp] = dictS[tmp]+1\n else:\n dictS[tmp]=1\n \nmax_n =max(dictS.values())\nmaxIndex = [x for x in dictS.items() if x[1] ==max_n ]\nans_list = []\nfor x in maxIndex:\n ans_list.append(x[0])\nans_list.sort()\nfor x in ans_list:\n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s643715594', 's702422799'] | [29076.0, 46168.0] | [2105.0, 534.0] | [321, 395] |
p02773 | u952114288 | 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. | ['k=int(input())\np=[input() for i in range(k)]\nm=0\na=[]\nfor j in frozenset(p):\n if not p.count(j)<m:\n a.append(j)\nprint("\\n".join(sorted(a)))', 'from collections import Counter\nk=int(input())\np=Counter(input() for f in range(k))\nj=sorted(p.most_common(), key=lambda a:1-a[1])\nj=[m[0] for m in j if m[1]==j[0][1]]\nprint("\\n".join(sorted(j)))'] | ['Wrong Answer', 'Accepted'] | ['s403902738', 's296881371'] | [29076.0, 45136.0] | [2109.0, 633.0] | [143, 195] |
p02773 | u954153335 | 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())\ndata=[""]*n\nfor i in range(n):\n data[i]=input()\ncount=collections.Counter(data)\nnum=max(count.values())\nfor v,k in count.items():\n if k==num:\n print(v)', 'import collections\nn=int(input())\ndata=[""]*n\nfor i in range(n):\n data[i]=input()\ndata=sorted(data)\ncount=collections.Counter(data)\nnum=max(count.values())\nfor v,k in count.items():\n if k==num:\n print(v)'] | ['Wrong Answer', 'Accepted'] | ['s224359667', 's482564294'] | [38884.0, 40932.0] | [344.0, 446.0] | [198, 216] |
p02773 | u957198490 | 2,000 | 1,048,576 | We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it. Print all strings that are written on the most number of votes, in lexicographical order. | ['import collections\nN = int(input())\nS = [str(input()) for i in range(N)]\nnew_S = collections.Counter(S)\nM = max(new_S.values())\n#X = []\nfor K,V in new_S.items():\n if V == M:\n print(K)', 'import collections\nN = int(input())\nS = [str(input()) for i in range(N)]\nnew_S = collections.Counter(S)\nM = max(new_S.values())\nX = []\nfor K,V in new_S.items():\n if V == M:\n X.append(K)\nX.sort()\nfor x in X:\n print(x)'] | ['Wrong Answer', 'Accepted'] | ['s999844326', 's739531841'] | [35572.0, 35568.0] | [479.0, 650.0] | [187, 221] |
p02773 | u957222656 | 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. | ['\nnum = input()\nl = []\nfor i in range(0,int(num)):\n l.append(input())\n\ncnt = []\nfor item in list(set(l)):\n cnt.append(l.count(item))\n\nnum_dict = dict(zip(list(set(l)),cnt))\nmax_v = max(num_dict.values())\n\nkeys = []\n\nfor word, num in num_dict.items():\n if num == max_v:\n keys.append(word)\n\nprint(sorted(keys))', '\nnum = input()\nl = []\nfor i in range(0,int(num)):\n l.append(input())\n\ncnt = []\nl_t = list(set(l))\nfor item in l_t:\n cnt.append(l.count(item))\n\nnum_dict = dict(zip(l_t),cnt))\nmax_v = max(num_dict.values())\n\nkeys = []\n\nfor word, num in num_dict.items():\n if num == max_v:\n keys.append(word)\n\nfor i in sorted(keys):\n print(i)', '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)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s019324203', 's915215226', 's898990182'] | [29076.0, 2940.0, 32480.0] | [2105.0, 17.0, 620.0] | [323, 341, 170] |
p02773 | u957843607 | 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_lis = []\nfor i in range(N):\n str_lis.append(ord(input()))\n\nmax_num = 0\nmax_str = []\nfor i in str_lis:\n if str_lis.count(i) > max_num and not i in max_str:\n max_num = str_lis.count(i)\n max_str = []\n max_str.append(i)\n elif str_lis.count(i) == max_num and not i in max_str:\n max_num = str_lis.count(i)\n max_str.append(i)\n \nnew_max_str = sorted(max_str)\n\nfor i in new_max_str:\n print(chr(i))', 'from collections import Counter\n\nN = int(input())\n\nstr_lis = [str(input()) for i in range(N)]\nc = Counter(str_lis)\na = c.most_common()\nnum = a[0][1]\nb = []\nfor i in a:\n if i[1] == num:\n b.append(i[0])\n num = i[1]\n else:\n break\n \nnew_b = sorted(b)\nfor i in new_b:\n print(i)'] | ['Runtime Error', 'Accepted'] | ['s718678421', 's138264763'] | [3064.0, 49196.0] | [18.0, 836.0] | [431, 287] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.