TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

n = int(input())
list = []
for x in range(n):
    s = input()
    list.append(s)
c = collections.Counter(list)
mc = c.most_common()
max = mc[0][1]
for val in mc:
    if max == val[1]: print(val[0])
    else: break


import collections

n = int(input())
list = []
for x in range(n):
    s = input()
    list.append(s)
c = collections.Counter(list)
mc = c.most_common()
max = mc[0][1]
anslist = []
for val in mc:
    if max == val[1]: anslist.append(val[0])
    else: break
anslist.sort
for x in anslist:
    print(x)


import collections

n = int(input())
list = []
for x in range(n):
    s = input()
    list.append(s)
c = collections.Counter(list)
mc = c.most_common()
max = mc[0][1]
anslist = []
for val in mc:
    if max == val[1]: anslist.append(val[0])
    else: break
anslist.sort()
for x in anslist:
    print(x)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
S = []
S_dict = {}
for i in range(N):
    S.append(input())
for i in range(N):
    if(S[i] in S_dict):
        S_dict[S[i]] = S_dict[S[i]]+1
    else:
        S_dict[S[i]] = int(1)
for i in range(len(S_dict)):
    if(S_dict[S[i]]== max(S_dict.values())):
        print(S[i])

import collections
N = int(input())
S = []

res = []
for i in range(N):
    S.append(input())

SS = collections.Counter(S)
for i in range(len(S_dict)):
    if(SS[S[i]]== max(SS.values())):
        res.append(S[i])
res.sort()
for i in range(len(res)):
    print(res[i])
    

import collections
N = int(input())
S = []

res = []
for i in range(N):
    S.append(input())

SS = collections.Counter(S)
m = max(SS.values())
for i in SS.keys():
    if(SS[i]== m):
        res.append(i)
res.sort()
for i in range(len(res)):
    print(res[i])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
def check(input_list):
    vote_dict = {}
    
    for a in input_list:
        if(a in vote_dict.keys()):
            vote_dict[a] += 1
        else:
            vote_dict[a] = 1
            
    return [k for k, v in vote_dict.items() if v == max(vote_dict.values())]

if __name__ == '__main__':
    num = int(input())
    input_list = [input() for a in range(num)]

    for str in check(input_list):
        print(str)


import collections

def check(input_list):

    vote_dict = collections.Counter(input_list)
    max_value = max(vote_dict.values())

    result_list = [k for k, v in vote_dict.items() if v == max_value]
    result_list.sort()
    
    return result_list

if __name__ == '__main__':
    num = int(input())
    input_list = [input() for a in range(num)]

    for str in check(input_list):
        print(str)
        

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import sys
input_first = input()
N= int(input_first)

wordl = []
timesl = []

for i in range(N):
    S = input()
    wordl.append(S)

maxnum = 1
tmp=1
resultl  =[]
for i in  range(N-1):
    if wordl[i] == wordl[i+1]:
        tmp +=1
    else:
        if maxval == tmp:
            resultl.append(wordl[i])
        elif maxval<tmp:
            resultl = []
            resultl.append(wordl[i])
            maxval = tmp
        else:
            pass
        tmp = 1


resultl.sort()

print(resultl)

import sys
input_first = input()
N= int(input_first)

wordl = []
timesl = []

for i in range(N):
    S = input()
    if S in wordl:
        timesl[wordl.index(S)] +=1
    else:
        wordl.append(S)
        timesl.append(1)

maxval =max(timesl) 
maxind = [j for j,val in enumerate(timesl) if val == maxval]

print("--------------------")
resultl=[]
for i in maxind:
    resultl.append(wordl[i])

resultl.sort()
print(resultl)


import sys
input_first = input()
N= int(input_first)

wordl = []
timesl = []

for i in range(N):
    S = input()
    if S in wordl:
        timesl[wordl.index(S)] +=1
    else:
        wordl.append(S)
        timesl.append(1)

maxval =max(timesl) 
maxind = [j for j,val in enumerate(timesl) if val == maxval]

for i in maxind:
    print(wordl[i])


import sys
input_first = input()
N= int(input_first)

worddic={}

for i in range(N):
    S = input()
    if S in worddic:
        worddic[S] +=1
    else:
        worddic[S] =1

# result=[keyval[0] for keyval in worddic.items() if keyval[1]==max(worddic.values())]

maxval = 0
for i in worddic.items():
    if i[1] > maxval :
        maxval = i[1]
        result=[]
        result.append(i[0])
    elif i[1] == maxval:
        result.append(i[0])
    else:
        pass

result.sort()
for i in result:
    print(i)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

N = int(input())
s = list(input().split())

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c:
  if value == max_num:
    d.append(key)
  else:
    break
    
for i in sorted(d):
  print(i)
  



import collections

N = int(input())
s = list(map(int, input().split()))

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c:
  if value == max_num:
    d.append(key)
  else:
    break
    
for i in sorted(d):
  print(i)
  



import collections

N = int(input())
s = [input() for i in range(N)]

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c.items():
  if value == max_num:
    d.append(key)

for i in sorted(d):
  print(i)

N = int(input())
s = [input() for i in range(N)]

n = N
max_num = 0
t = []
while n >= max_num:
    word = s[0]
	count = 0
    for i in s:
      if i == word:
        count += 1
        
    if count > max_num:
      max_num = count
      t = [s[0]]
    elif count == max_num:
      t = t.append(s[0])
      
    s = [i for i in s if i != word]
    n = len(s)

t = sorted(t)
for i in range(t):
  print(i)

import collections

N = int(input())
s = list(map(int, input().split()))

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c.items():
  if value == max_num:
    d.append(key)
  else:
    break
    
for i in sorted(d):
  print(i)
  



import collections

N = int(input())
s = [input() for i in range(N)]

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c.items():
  if value == max_num:
    d.append(key)
  else:
    break

for i in sorted(d):
  print(i)

import collections

N = int(input())
s = [input() for i in range(N)]

c = collections.Counter(s)
max_num = list(c.values())[0]
d = []
for key,value in c:
  if value == max_num:
    d.append(key)
  else:
    break
    
for i in sorted(d):
  print(i)
  



import collections

N = int(input())
s = [input() for i in range(N)]

c = collections.Counter(s)
max_num = max(c.values())
d = []
for key,value in c.items():
  if value == max_num:
    d.append(key)

for i in sorted(d):
  print(i)


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
n=int(input())
poll=[input() for i in range(n)]

dic={}
for string in poll:
  if string not in dic:
    dic[string]=1
  else:
    dic[string]+=1

max_k=[k for k, v in dic.items() if v == max(dic.values())]
print(*max_k,sep='\n')

def main():
  n=int(input())
  poll=[input() for i in range(n)]

  dic={}
  for string in poll:
    if string not in dic:
      dic[string]=1
    else:
      dic[string]+=1
  
  x=max(dic.values()) 
  max_k=[k for k, v in dic.items() if v==x]
  max_k.sort()
  print(*max_k,sep='\n')
  
if __name__=='__main__':
  main()

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
print()

N = int(input())

dic = {}

for i in range(N):
	key = input()
	if key not in dic:
		dic[key] = 0
	else:
		dic[key] +=1

maxnum = max(dic.values())

keys = list(dic.keys())
for key in reversed(keys):
	if dic[key] == maxnum:
		print(key)




N = int(input())

dic = {}

for i in range(N):
	key = input()
	if key not in dic:
		dic[key] = 1
	else:
		dic[key] +=1

maxnum = max(dic.values())
#print(maxnum)
#print(dic)

keys = list(dic.keys())
for key in sorted(keys):
	if dic[key] == maxnum:
		print(key)




Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

n = int(input())
st = [input() for i in range(n)]

c = collections.Counter(st)
c.most_common()
c_val = list(c.values())
c_key = list(c.keys())

counter = 0
res = []
if len(c_val) == 1:
  print(c_key[0])
else:
  for i in range(len(c_val)):
    if c_val[i] >= counter:
      counter = c_val[i]
      res.append(c_key[i])
  res = list(set(res))
  res.sort()
  
  for i in range(len(res)):
    print(res[i])

import collections
 
n = int(input())
st = [input() for i in range(n)]
 
c = collections.Counter(st)
c.most_common()
c_val, c_key= zip(*c.most_common()) 
c_key,c_val = list(c_val),list(map(int,c_key))
counter = 0
res = []
if len(c_val) == 1:
  print(c_key[0])
else:
  for i in range(len(c_val)):
    if c_val[i] >= counter:
      counter = c_val[i]
      res.append(c_key[i])
  res = list(set(res))
  res.sort()
  
  for i in range(len(res)):
    print(res[i])


Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
c=Counter(s)
sort(c.items())
max_cnt=max(c.values())
names=[name for k,v in c if v==max_cnt]
print(names)

from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
c=Counter(a)
sorted(c.items())
max_cnt=max(c.values())
print(max_cnt)
names=[name for name,v in c.items() if v==max_cnt]
print(*names,sep='\n')

from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
c=Counter(a)
sorted(c.items())
max_cnt=max(c.values())
names=[name for name,v in c.items() if v==max_cnt]
print(*names,sep='\n')

from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
c=Counter(a)
sorted(c.items())
max_cnt=max(c.values())
print(max_cnt)
names=[name for name,v in c.items() if v==max_cnt]
print(names)

from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
c=Counter(a)
max_cnt=max(c.values())
names=[name for name,v in c.items() if v==max_cnt]
names.sort()
print(*names,sep='\n')

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
n = int(input())
s = [0]*n
for i in range(n):
    s[i] = input()

set_s = set(s)
cnt_s = collections.Counter(s)
m=0
for i in set_s:
    m = max(m,cnt_s[i])
    
for i in set_s:
    if cnt_s[i]==m:
        print(i)



import collections
n = int(input())
s = [0]*n
for i in range(n):
    s[i] = input()

set_s = set(s)
cnt_s = collections.Counter(s)

m=0
for i in set_s:
    m = max(m,cnt_s[i])
ans=[]
for i in set_s:
    if cnt_s[i]==m:
        ans.append(i)
ans = sorted(ans)

for a in ans:
    print(a)



Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import sys
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input()) 
c = collections.Counter(S)
a = c.most_common()
s = c.most_common()[0][1]
ans = []
for i in a:
    if i[1] == s:
        print(i[0])

import sys
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input()) 
c = collections.Counter(S)
a = c.most_common()
s = c.most_common()[0][1]
ans = []
for i in a:
    if i[1] == s:
        print(i[0])

import sys
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input()) 
c = collections.Counter(S)
a = c.most_common()
s = c.most_common()[0][1]
ans = []
for i in a:
    if i[1] == s:
        print(i[0])
        sys.stdout.flush 

import sys
import collections

N = int(input())
S = []
for _ in range(N):
    S.append(input()) 
c = collections.Counter(S)
a = c.most_common()
s = c.most_common()[0][1]
ans = []
for i in sorted(a):
    if i[1] == s:
        print(i[0])
        sys.stdout.flush 

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())
out = []

for key,val in dic.items():
    if val == max:
        out.append(val)
out.sorted()
for val in range(len(out)):
    print(val)

N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())

for key,val in dic.items():
    if val == max:
        print(key)

N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())
out = []

for key,val in dic.items():
    if val == max:
        out.append(key)

out.sort()
for key in out:
    print(key)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N=int(input())
s={}
maxs=0
for i in range(N):
  S=input()
  if S not in s:
    s[S]=0
  else:
    s[S]+=1
    maxs=max(maxs,s[S])
s2=sorted(s.items(), key=lambda x:x[0])
ans=[]
for S in s:
  if s[S]==maxs:
    ans.append(S)
for A in ans:
  print(A)

N=int(input())
s={}
maxs=0
for i in range(N):
  S=input()
  if S not in s:
    s[S]=0
  else:
    s[S]+=1
    maxs=max(maxs,s[S])
s2=sorted(s.items(), key=lambda x:x[0])
ans=[]
for S in s:
  if s[S]==maxs:
    ans.append(S)
for A in ans:
  print(A)

N=int(input())
s={}
maxs=0
for i in range(N):
  S=input()
  if S not in s:
    s[S]=0
  else:
    s[S]+=1
    maxs=max(maxs,s[S])
s=sorted(s.items(), key=lambda x:x[0])

ans= [S for S, i in s if i == maxs]
for A in ans:
  print(A)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S)
ss = list(s)

count = 0 
max = 0
for i in ss:
    if s[i] > max:
        count = 1
        max = s[i]
    elif s[i] == max:
        count += 1

for i in range(count):
	print(s.most_common()[i][0])

#bA
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) 

maximum = max(S.values())
list = sorted(key for key,value in s.items() if value==maximum)


for i in list:
    print(i)

import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) 

maximum = max(S.values())
list = sorted(key for key,value in s.items() if value==maximum))


for i in list:
    print(i)

N=int(input())
S=[input() for i in range(N)]
dictionary={}
for word in S:
    if word in dictionary:
        dictionary[word]+=1
    else:
        dictionary[word]=1
maximum=max(dictionary.values())
for key,value in sorted(dictionary.items()):
    if value==maximum:
        print(key)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
# import math


def resolve():
    N = int(input())
    S = []
    for i in range(N):
        ss = input()
        S.append(ss)

    counter = collections.Counter(S)
    _, max_count = counter.most_common()[0]

    for key in counter:
        if (counter[key] == max_count):
            print(key)


resolve()


import collections
# import math


def resolve():
    N = int(input())
    S = []
    for i in range(N):
        ss = input()
        S.append(ss)

    counter = collections.Counter(S)
    _, max_count = counter.most_common()[0]

    ans = []

    for key in counter:
        if (counter[key] == max_count):
            ans.append(key)

    ans.sort()

    for a in ans:
        print(a)


resolve()


Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
N=int(input())
S=[input() for i in range(N)]

c=collections.Counter(S)
most=c.most_common()
m_cnt=most[0][1]
for i in most:
    if i[1]==m_cnt:
        print(i[0])
    else:
        break

import collections
N=int(input())
S=[input() for i in range(N)]

c=collections.Counter(S)
most=c.most_common()
m_cnt=most[0][1]

dicts=[]

for i in most:
    if i[1]==m_cnt:
        dicts.append(i[0])
    else:
        break
dicts.sort()
for i in dicts:
    print(i)

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
n = int(input())
mozi = list()
for i in range(n):
    mozi.append(input())
mozi.sort()
li = list()
for i in range(n):
    if not mozi[i] in li:
        li.append(mozi[i])
kazu = list()
for i in li:
    kazu.append(mozi.count(i))
m = [i for i ,x in enumerate(kazu) if x == max(kazu)]
for i in m:
    print(li[i],end=" ")

from collections import Counter 

n = int(input())
li = list()
for _ in range(n):
    li.append(input())
a = Counter(li)
b = max(a.values())
m = [x[0] for x in a.items() if x[1] == b]
m.sort()
for i in m:
    print(i)

Verdicts: Time Limit Exceeded

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
s = [input() for i in range(N)]
from collections import Counter
s1 = sorted(s)
 
c = collections.Counter(s1)
s2 = c.most_common()
 
#print(s2)
a = 0
for i in range(len(s2)):
    if s2[0][1] == s2[i][1]:
        a = a + 1
 
for i in range(a):
    print(str(s2[i][0]))

N = int(input())
s = [input() for i in range(N)]
import collections
s1 = sorted(s)
 
c = collections.Counter(s1)
s2 = c.most_common()
 
s3 = []
a = 0
for i in range(len(s2)):
    if s2[0][1] == s2[i][1]:
        s3.append(s2[i][0])
s4 = sorted(s3)
for i in range(len(s4)):
    print(s4[i])

Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
def mostFrequent(L):
  return max(set(L), key = L.count)

N = input()
L = []
for i in range(0,N):
  L.append(input())
print(mostFrequent(L))

def mostFrequent(L):
  return max(set(A), key = A.count)

N = input()
L = []
for i in range(0,N):
  L.append(input())
print(mostFrequent(L))

N = input()
L = []
for i in range(0,N):
	L.append(input())
    
def mostFrequent(L):
  return max(set(A), key = A.count)

print(mostFrequent(L))

from collections import defaultdict
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
from collections import Counter

n=int(input())
S=[input() for _ in range(n)]

c=Counter(s)
m=max(c.values())
ans = sorted(k for k,v in c.items() if v == m)
print("\n".join(ans))

from collections import Counter

n=int(input())
S=[input() for _ in range(n)]

c=Counter(S)
m=max(c.values())
ans = sorted(k for k,v in c.items() if v == m)
print("\n".join(ans))

Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())
for k, v in c.items():
  if v == max_count:
    print(k)

from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())

out_k = []
for k, v in c.items():
  if v == max_count:
    out_k.append(k)
sort(out_k)
for k in out_k:
  print(k)

from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

print(c)
max_count = max(c.values())
for k, v in c.items():
  if v == max_count:
    print(k)

from collections import Counter

N = int(input())
ss = []
for i in range(N):
  ss.append(input())

c = Counter(ss)

max_count = max(c.values())

out_k = []
for k, v in c.items():
  if v == max_count:
    out_k.append(k)
out_k.sort()
for k in out_k:
  print(k)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
n = int(input())
s = [input() for i in range(n)]
s.sort()
l = set(s)
ms = len(s) - len(l)
if ms == 0:
    print("\n".join(s))
    exit()

ans = 0
ans_l = []
for i in l:
    sc = s.count(i)
    if sc > ans:
        ans_l = [i]
        ans = sc
    elif sc == ans:
        ans_l.append(i)
      
print("\n".join(ans_l))

n = int(input())
s = [input() for i in range(n)]
s.sort()
l = sorted(set(s))
ms = len(s) - len(l)
if ms == 0:
    print("\n".join(s))
    exit()

ans = 0
ans_l = []
for i in l:
    if ms >= -1:
      sc = s.count(i)
      if sc > ans:
        ans_l = [i]
        ans = sc
        ms -= sc
      elif sc == ans:
        ans_l.append(i)
        ms -= sc
    else:
      exit()
      
print("\n".join(ans_l))

n = int(input())
s = [input() for i in range(n)]
s.sort()
l = sorted(set(s))
if len(s) == len(l):
    print("\n".join(s))
    exit()
if len(l):
    print("\n".join(s[0]))
    exit()

ans = 0
ans_l = []
for i in l:
    sc = s.count(i)
    if sc > ans:
        ans_l = [i]
        ans = sc
    elif sc == ans:
        ans_l.append(i)
      
print("\n".join(ans_l))

from collections import Counter

n = int(input())
S = [input() for i in range(n)]

s = Counter(S)
print(s)
max_cnt = s.most_common()[0][1]
names = [name for name, cnt in s.items() if cnt == max_cnt]
names.sort()

print("\n".join(names))

n = int(input())
s = [input() for i in range(n)]
s.sort(reverse=True)
l = set(s)
ms = len(s) - len(l)
if len(l) == 1:
    print(s[0])
    exit()
elif len(l) == n:
    s.sort()
    print("\n".join(s))
    exit()

ans = 0
ans_l = []
for i in l:
    sc = s.count(i)
    if sc > ans:
        ans_l = [i]
        ans = sc
    elif sc == ans:
        ans_l.append(i)
      
print("\n".join(ans_l))

from collections import Counter

n = int(input())
S = [input() for i in range(n)]

s = Counter(S)
max_cnt = s.most_common()[0][1]
names = [name for name, cnt in s.items() if cnt == max_cnt]
names.sort()

print("\n".join(names))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
from collections import Counter
n = int(input())
#li = ['apple', 'orange', 'apple', 'banana', 'grape','orange']
li = []
for i in range(n):
    li.append(input())

#print(li)

dic = Counter(li)
#print(dic.most_common())
#print(max(dic.values()))
max = max(dic.values())

for k,v in dic.items():
    if(v == max):    
        print(k)



from collections import Counter
n = int(input())
#li = ['apple', 'orange', 'apple', 'banana', 'grape','orange']
li = []
for i in range(n):
    li.append(input())

#print(li)

dic = Counter(li)
#print(dic.most_common())
#print(max(dic.values()))
max = max(dic.values())

list=[]

for k,v in dic.items():
    if(v == max):    
        list.append(k)


list = sorted(list)

#print(list)

for i in range(len(list)):
    print(list[i])



Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
words = []
for _ in range(N):
    words.append(input())
count_table = {}
for w in words:
    if w in count_table:
        count_table[w] += 1
    else:
        count_table[w] = 0
best_count = 0
for w in count_table:
    if best_count < count_table[w]:
        best_count = count_table[w]
        best_words = [w]
    elif best_count == count_table[w]:
        best_words.append(w)
for w in sorted(best_words):
    print(w)

N = int(input())
words = []
for _ in range(N):
    words.append(input())
count_table = {}
for w in words:
    if w in count_table:
        count_table[w] += 1
    else:
        count_table[w] = 0
best_count = 0
best_words = []
for w in count_table:
    if best_count < count_table[w]:
        best_count = count_table[w]
        best_words = [w]
    elif best_count == count_table[w]:
        best_words.append(w)
for w in sorted(best_words):
    print(w)

Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

N = int(input())

S = []
for _ in range(N):
    S.append(input())

c = collections.Counter(S)
c1 = c.most_common()

# print(c1[0][0])

tmp = []
for i in range(len(c1)):
    tmp.append(c1[i][0])
    print(sorted(tmp))
    if (c1[0][1] > c1[i][1]):
        break

ans = sorted(tmp)
for i in range(len(ans)):
    print(ans[i])

import sys 
from collections import Counter

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
l = read().decode().split()
c = Counter(l)

max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]

print('\n'.join(sorted(ans)))

Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
n = int(input())
ls = [input() for i in range(n)]    
c = collections.Counter(ls)
count = c.most_common()[0][1]
ans = []
if c.most_common()[0][1] == 1:
    ls.sort()
    for i in ls:
        print(i)
else:
    c.sort()
    for i in range(len(c)):
        p = c.most_common()
        if p[i][1] == count:
            print(p[i][0])
        else:
            break   

import collections
n = int(input())
ls = [input() for i in range(n)]    
c = collections.Counter(ls)
count = c.most_common()[0][1]
ans = []
if c.most_common()[0][1] == 1:
    ls.sort()
    for i in ls:
        print(i)
else:
    for i in range(len(c)):
        p = c.most_common()
        if p[i][1] == count:
            ans.append(p[i][0])
        else:
            break   
    ans = sorted(ans
    for i in ans:
      print(i)

import collections

n = int(input())
ls = [input() for i in range(n)]    
c = collections.Counter(ls)

count = c.most_common()[0][1]
ans = []
p = c.most_common()
for i in range(len(c)):
    if p[i][1] == count:
        ans.append(p[i][0])
    else:
        break   
ans = sorted(ans)
for i in ans:
    print(i)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import math
from functools import reduce
import itertools

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))





N=input1()
S=[]
for _ in range(N):
	S.append(str(input()))

dic={}
results=[]
for s in S:
	if s not in dic:
		dic[s]=1
	else:
		dic[s]+=1
ans=10000010010


score_sorted = sorted(dic.items(), key=lambda x:x[1])
max_count=max(dic.values())
for x in score_sorted:
	if x[1]==max_count:
		print(x[0])




import math
from functools import reduce
import itertools

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))





N=input1()
S=[]
for _ in range(N):
	S.append(str(input()))

dic={}
results=[]
for s in S:
	if s not in dic:
		dic[s]=1
	else:
		dic[s]+=1
ans=10000010010


score_sorted = sorted(dic.items(), key=lambda x:x[1])
print(score_sorted)
max_count=max(dic.values())
for x in score_sorted:
	if x[1]==max_count:
		results.append(x[0])
results.sort()
for i in results:
	print(i)








import math
from functools import reduce
import itertools

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))





N=input1()
S=[]
for _ in range(N):
	S.append(str(input()))

dic={}
results=[]
for s in S:
	if s not in dic:
		dic[s]=1
	else:
		dic[s]+=1
ans=-1

# 	if ans==0:
# 		ans=v
# 	elif ans==v:

score_sorted = sorted(dic.items(), key=lambda x:x[1], reverse=True)

for x in score_sorted:
	if x[1]>=ans:
		print(x[0])
		ans=x[1]
	else:
		break



















import math
from functools import reduce
import itertools

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))





N=input1()
S=[]
for _ in range(N):
	S.append(str(input()))

dic={}
results=[]
for s in S:
	if s not in dic:
		dic[s]=1
	else:
		dic[s]+=1
ans=10000010010


score_sorted = sorted(dic.items(), key=lambda x:x[1])

max_count=max(dic.values())
for x in score_sorted:
	if x[1]==max_count:
		results.append(x[0])
results.sort()
for i in results:
	print(i)








Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
n = int(input())
s = sorted([str(input()) for _ in range(n)])

S = set(s)
c_m = int(0)
l = []
ans = []

for i in range(len(S)):
    a = S.pop()
    c_i = int(s.count(a))
    if c_i >= c_m:
        c_m = c_i
        l.append([c_m, a])
        continue

l.sort(reverse = True)
for i in range(len(l)):
    if l[0][0] == l[i][0]:
        ans = l[i][1]
        print(ans)


n = int(input())
d = dict()
for _ in range(n):
    x = str(input())
    if x in d:
        d[x] += 1
        continue
    else:
        d[x] = 0

d_sort = sorted(d.items(), key=lambda d:d[1], reverse = True)
d_max = d_sort[0][1]

ans = []
for i in d_sort:
    if d_max == i[1]:
        ans.append(i[0])
    else:
        break

ans.sort()
for a in ans:
    print(a)


Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

n = int(input())
s_list = []
for _ in range(n):
    s_list.append(input())
s_data = collections.Counter(s_list).most_common()
s_count = s_data[0][1]
s_index = 1
for s in s_data:
    if s[1] == s_count:
        s_index += 1
    else:
        break
    

for i in range(s_index):
    print(s_data[i][0])

import collections

n = int(input())
s_list = []
for _ in range(n):
    s_list.append(input())
s_data = list(collections.Counter(s_list).most_common())
s_count = int(s_data[0][1])
s_index = 0
for s in s_data:
    if int(s[1]) == s_count:
        s_index += 1
    else:
        break
output = []
for i in range(s_index):
    output.append(s_data[i][0])
output.sort()
for s in output:
    print(s)


Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
S_list = []
for i in range(N):
    x = input()
    S_list.append(x)
another_list = [S_list[0]]
cnt_list = [1]
for i in range(1, N):
    for j in range(len(another_list)):
        if another_list[j] == S_list[i]:
            cnt_list[j] += 1
            break
    if j == len(another_list)-1:
        another_list.append(S_list[i])
        cnt_list.append(1)
max_v = max(cnt_list)
cnt = []
for i in range(len(cnt_list)):
    if max_v == cnt_list[i]:
        cnt.append(i)
cnt1 = []
for i in range(len(cnt)):
    cnt1.append(another_list[cnt[i]])
if len(cnt1) > 2:
    for _ in range(len(cnt1)-1):
        for i in range(len(cnt1)-1):
            tmp = "s"
            if ord(cnt1[i][0]) > ord(cnt1[i+1][0]):
                tmp = cnt1[i+1][0] 
                cnt1[i+1][0] = cnt1[i][0]
                cnt1[i][0] = tmp
print(cnt1)


N = int(input())
S_list = []
for i in range(N):
    x = input()
    S_list.append(x)
another_list = [S_list[0]]
cnt_list = [1]
for i in range(1, N):
    for j in range(len(another_list)):
        if another_list[j] == S_list[i]:
            cnt_list[j] += 1
            break
    if j == len(another_list)-1:
        another_list.append(S_list[i])
        cnt_list.append(1)
max_v = max(cnt_list)
cnt = []
for i in range(len(cnt_list)):
    if max_v == cnt_list[i]:
        cnt.append(i)
cnt1 = []
for i in range(len(cnt)):
    cnt1.append(another_list[cnt[i]])
for i in range(len(cnt1)):
    print("{}".format(cnt1[i]))

N = int(input())
S_dic = {}
for i in range(N):
    S = input()
    if S in S_dic:
        S_dic[S] += 1
    else:
        S_dic[S] = 1
max_v = max(S_dic.values())
ans_list = [key for key, val in S_dic.items() if val == max_v]
ans_list.sort()
print("\n".join(ans_list))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
from collections import Counter

n = int(input())

s = [input() for _ in range(n)]

c = Counter(s)

csort = sorted(c.items(), key=lambda x:x[1],reverse=True)

maxc = csort[0][1]

for s,v in csort:
    if v == maxc:
        print(s)

from collections import Counter

n = int(input())

s = [input() for _ in range(n)]

c = Counter(s)

csort = sorted(c.items(), key=lambda x:x[1],reverse=True)

maxc = csort[0][1]
ans = []
for s,v in csort:
    if v == maxc:
        ans.append(s)
        
anssort = sorted(ans)

for s in anssort:
    print(s)

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import numpy as np

n = int(input())
s_list = [input() for i in range(n)]

new_dict = {}
for s in s_list:
    if s not in new_dict.keys():
        new_dict[s] = 1
    else:
        new_dict[s] += 1
    
values = []
keys = []    
for key in new_dict.keys():
    values.append(new_dict[key])
    keys.append(key)
    
values = np.array(values)
keys = np.array(keys)

max_index = values == np.max(values)
keys = keys[max_index].tolist()

for key in keys:
    print(key)

import numpy as np

n = int(input())
s_list = [input() for i in range(n)]

new_dict = {}
for s in s_list:
    if s not in new_dict.keys():
        new_dict[s] = 1
    else:
        new_dict[s] += 1
    
values = []
keys = []    
for key in new_dict.keys():
    values.append(new_dict[key])
    keys.append(key)
    
values = np.array(values)
keys = np.array(keys)

max_index = values == np.max(values)
keys = keys[max_index].tolist()
keys = sorted(keys)

for key in keys:
    print(key)

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
word_count = {}
for i in range(N):
    word = input()
    if word not in word_count:
        word_count[word] = 1
    else:
        word_count[word] += 1

counts = [val for (key, val) in word_count.items()]
max_count = max(counts)
words = [key for (key, val) in word_count.items() if val == max_count]
for word in words:
    print(word)


N = int(input())
word_count = {}
for i in range(N):
    word = input()
    if word not in word_count:
        word_count[word] = 1
    else:
        word_count[word] += 1

counts = [val for (key, val) in word_count.items()]
max_count = max(counts)
words = sorted([key for (key, val) in word_count.items() if val == max_count])
for word in words:
    print(word)


Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
import sys
N = int(input())
S = [input() for _ in range(N)]



c = collections.Counter(S)
ans = []

for i in range(len(c.most_common())):
    if i == 0:
        print(c.most_common()[0][0])
    
    if i != 0:
        if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):
            ans.append(((c.most_common()[i][0])))
        else:
            break

ans2 = sorted(ans)
for i in ans2:
    print(i)

import collections
import sys
N = int(input())
S = [input() for _ in range(N)]



c = collections.Counter(S)


for i in range(len(c.most_common())):
    if i == 0:
        print(c.most_common()[0][0])
    
    if i != 0:
        if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):
            print((c.most_common()[i][0]))
        else:
            sys.exit()

import collections
import sys
N = int(input())
S = [input() for _ in range(N)]



c = collections.Counter(S)
ans = []

for i in range(len(c.most_common())):
    if i == 0:
        print(c.most_common()[0][0])
    
    if i != 0:
        if (c.most_common()[i-1][1]) == (c.most_common()[i][1]):
            ans.append(((c.most_common()[i][0])))
        else:
            break
ans.sort()

for i in ans:
    print(i)

import collections
import sys
N = int(input())
S = [input() for _ in range(N)]

c = collections.Counter(S)
ans = []
li=c.most_common()
for i in range(len(li)):
    if i == 0:
        ans.append(((li[0][0])))
    
    if i != 0:
        if (li[i-1][1]) == (li[i][1]):
            
            ans.append(((li[i][0])))
        else:
            break

ans.sort()

for i in ans:
    print(i)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
strlist = []
N = int(input())
for i in range(N):
    strlist.append(str(input()))
c = collections.Counter(strlist)
p = max(c.values())
for i in c.most_common():
    if i[1] == p:
        print(i[0])

import collections
strlist = []
answer = []
N = int(input())
for i in range(N):
    strlist.append(str(input()))
    
c = collections.Counter(sorted(strlist))
p = max(c.values())
for i in c.most_common():
    if i[1] == p:
        print("{}\n".format(i[0]))

import collections
strlist = []
answer = []
N = int(input())
for i in range(N):
    strlist.append(str(input()))
    
c = collections.Counter(strlist)
p = max(c.values())
ans = sorted([k for k,v in c.items() if p==v])
print('\n'.join(ans))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

N = int(input())
S = [input() for _ in range(N)]

cnt = collections.Counter(S)
max_cnt = max(cnt.values())

ans_list = []

for key, value in cnt.items():
    print(key, value)
    if value == max_cnt:
        ans_list.append(key)

print(*sorted(ans_list), sep='\n')



import collections

N = int(input())
S = [input() for _ in range(N)]

cnt = collections.Counter(S)
max_cnt = max(cnt.values())

ans_list = []

for key, value in cnt.items():
    if value == max_cnt:
        ans_list.append(key)

print(*sorted(ans_list), sep='\n')



Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())

S = []

for i in range(N):
  S.append(input())

set_S = list(set(S))
ans = []
max_cnt = 0
for i in range(len(set_S)):
  cnt = 0
  for j in range(N):
    if set_S[i] == S[j]:
      cnt += 1
  if max_cnt < cnt:
    temp = [set_S[i],cnt]
    ans.append(temp)

ans_f = []

for i in range(len(set_S)):
  if ans[i][1] == max_cnt:
    ans_f.append(ans[i][0])

ans_f.sort()

for i in range(len(ans_f)):
  print(ans_f[i])

N = int(input())

d = {}

for _ in range(N):
  S = input()
  if S in d:
    d[S] += 1
  else:
    d[S] = 1

m = max(d.values())

for s in sorted(k for k in d if d[k] == m):
  print(s)

Verdicts: Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
# -*- coding: utf-8 -*-
from collections import Counter
# input
n = int(input())
s = []
for i in range(n):
    s.append(input())
c = Counter(s)
# output
#ma = c.most_common()[0][1]
o = list(k for k, v in s.items() if v == s.most_common()[0][1])

o.sort()
print('\n'.join(o))


# -*- coding: utf-8 -*-
from collections import Counter
# input
n = int(input())
s = []
for i in range(n):
    s.append(input())
c = Counter(s)
# output
ma = c.most_common()[0][1]

o = [k for k, v in c.items() if v == ma]
# o.sort()
# print('\n'.join(o))
for i in sorted(o):
    print(i)


Verdicts: Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections

n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)
return

n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)

import collections

n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
N = int(input())
S = list(input() for i in range(N))  

A = {}
for i in S:
    A.setdefault(i, 1)
    A[i] += 1

B = max(A.values())
C = [i for i in A if A[i] == B]
C = sorted(C)
print(C)

N = int(input())
S = list(input() for i in range(N))  
S = sorted(S)

import collections
A = collections.Counter(S)

max_k_list = [kv[0] for kv in A.items() if kv[1] == max(A.values())]
print(max_k_list)

N = int(input())
S = list(input() for i in range(N))  

import collections
A = collections.Counter(S)

B = max(A.values())
C = [i for i in A.keys() if A[i] == B]
C = sorted(C)

for i in C:
    print(i)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.  Print all strings that are written on the most number of votes, in lexicographical order.

Submission attempts (in order):
import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
max_c_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
print(sorted(max_c_list))

import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = soreted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)

import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = sorted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)

Verdicts: Wrong Answer

Runtime Error

Accepted