submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s986727906
p00028
Accepted
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from datetime import date n = [0]*101 for s in sys.stdin: d = int(s) n[d] += 1 m = max(n) for i in [ j for j in range(len(n)) if n[j] == m ]: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s160945092
p00028
Accepted
import sys num_max = 0 frequency = [0] * 101 for line in sys.stdin: num = int(line) frequency[num] += 1 num_max = max(num_max, frequency[num]) for i in range(len(frequency)): if num_max == frequency[i]: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s964873170
p00028
Accepted
dic={} while True: try: n = int(raw_input()) if n not in dic: dic[n] = 1 else: dic[n] += 1 except: break mode = [] m = 0 for k,v in sorted(dic.items(),key = lambda x:x[1],reverse=True): if m==0: mode.append(k) m +=1 if v == dic[mode[-1]] and k!=mode[-1]: mode.append(k) for i in range(len(mode)): print mode[i]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s869969376
p00028
Accepted
list=[0]*100 while True: try: n=int(input()) except: break list[n-1]+=1 max=max(list) for i in range(len(list)): if list[i]==max: print(i+1)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s545590831
p00028
Accepted
import sys integer=[0]*101 for dataset in sys.stdin: integer[int(dataset)]+=1 max=list(integer) max.sort() smax=max.pop() solve=[i for i in range(101) if integer[i]==smax] while len(solve)!=0: print solve.pop(0)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s307484907
p00028
Accepted
import sys import math l=[] for i in range(101): l.append(0) while 1: try: a = int(raw_input()) l[a] += 1 except: flag = 0 for i in range(101): flag = max(flag, l[i]) for i in range(101): if l[i] == flag: print i break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s908139504
p00028
Accepted
dic = {} while True: try: num = int(raw_input()) if not num in dic: dic[num] = 1 else: dic[num] = dic[num] + 1 except EOFError: max_num = 0 index = 0 for k, v in sorted(dic.items(), key=lambda x: x[1], reverse=True): if index == 0: max_num = v if max_num != v: break print k index += 1 break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s993155279
p00028
Accepted
import sys count = [0 for _ in range(101)] mode = 0 for s in sys.stdin: x = int(s) count[x] += 1 mode = max(mode, count[x]) for i in range(101): if count[i] == mode: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s968534853
p00028
Accepted
l=[0]*101 while 1: try: n=int(raw_input()) l[n]+=1 except: break chk=max(l) for i,j in enumerate(l): if j==chk: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s582860577
p00028
Accepted
# -*- coding:utf-8 -*- def main(): LIST=[] while True: try: N=int(input()) flag=True for item in LIST: if item[0]==N: index=LIST.index(item) flag=False if flag: LIST.append([N,1]) else: LIST[index][1]+=1 except: break m=0 for i in LIST: m=max(m,i[1]) ans=sorted([x for x in LIST if x[1]==m],key=lambda x:x[0]) for i in ans: print(i[0]) if __name__ == '__main__': main()
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s215508812
p00028
Accepted
import sys l = [] max_c = 0 n = [] for i in sys.stdin.readlines(): l.append(int(i)) if l.count(int(i)) == max_c: n.append(int(i)) elif l.count(int(i)) > max_c: n = [int(i)] max_c = l.count(int(i)) n.sort() for i in n: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s146811632
p00028
Accepted
from math import * PI = 3.1415926535898 res = [0]*111 arr = [] ans = 0 while True: try: n = input() res[n] += 1 arr.append(n) except EOFError: break ma = max(res) for i in range(101): if arr.count(i) == ma: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s724947379
p00028
Accepted
A=[] while True: try: x=int(input()) A.append(x) except EOFError: break num=[] for i in range(101): num.append((A.count(i),i)) num.sort(reverse=True) mode_value=num[0][0] B=[] for i in num: if i[0]==mode_value: B.append(i[1]) B.sort() for i in B: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s613321483
p00028
Accepted
a = [] ary = [0] * 101 while True: try: c = int(input()) except EOFError: break a.append(c) ary[c] += 1 for i in range(1, 101): if ary[i] == max(ary): print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s462284820
p00028
Accepted
#encoding=utf-8 import sys num, ans = [], [] for i in sys.stdin: num.append(int(i)) for i in xrange(1,101): ans.append(num.count(i)) for i in xrange(1,100): if max(ans) == ans[i]: print i + 1
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s373148559
p00028
Accepted
import collections import sys cntr = collections.Counter() for line in sys.stdin: cntr[int(line)] += 1 lst = [] for k,v in cntr.items(): lst.append((v,k)) lst.sort() t = len(lst)-1 while t>0 and lst[t][0] == lst[t-1][0]: t -= 1 for i in range(t,len(lst)): print(lst[i][1])
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s204313459
p00028
Accepted
# -*- coding: utf-8 -*- import sys dic = {} for line in sys.stdin: i = int(line) if i not in dic: dic[i] = 1 else: dic[i] += 1 Max = 0 for i in dic: Max = max(Max, dic[i]) ans = [] for i in dic: if dic[i] == Max: ans.append(i) ans.sort() for i in ans: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s980453892
p00028
Accepted
import sys S = sys.stdin.readlines() cnt = [0] * 101 for s in S: n = int(s) cnt[n] += 1 m = max(cnt) n = cnt.count(m) p = 0 for i in range(n): p = cnt.index(m) print(p) cnt[p] = 0
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s037040806
p00028
Accepted
m=[0]*100 while 1: try: n=input() m[n-1]+=1 except: break mmax=max(m) for i in xrange(100): if m[i]==mmax: print(i+1)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s963008768
p00028
Accepted
import sys d = {} for l in sys.stdin.readlines(): d[int(l)] = d.get(int(l), 0) + 1 l = sorted(d, key=d.get) n = d[l[-1]] for x in l: if d[x] == n: print(x)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s511730956
p00028
Accepted
import sys arr = {} for i in sys.stdin: if int(i) in arr: arr[int(i)] += 1 else: arr[int(i)] = 1 max = 0 ans = [] for i in arr.keys(): if arr[i] > max: ans = [i] max = arr[i] elif arr[i] == max: ans.append(i) for i in ans: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s925468870
p00028
Accepted
from collections import Counter c = Counter() try: while 1: c[int(input())] += 1 except: pass m = c.most_common(1)[0][1] r = [n for n in c if c[n] == m] r.sort() for v in r: print(v)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s308612529
p00028
Accepted
# -*- coding: utf-8 -*- DICT = {k: 0 for k in range(1, 101)} def solve(d): _max = max(d.values()) for k, v in sorted(d.items()): if _max == v: print(k) if __name__ == '__main__': while True: try: n = int(input()) DICT[n] += 1 except: break solve(DICT)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s499035614
p00028
Accepted
h = {} while True: try: a = int(input()) if a in h: h[a] += 1 else: h[a] = 1 except EOFError: break #print(h) l = [(mode, 10000 - num) for num, mode in h.items()] l.sort(reverse=True) max_mode, num = l[0] print(10000 - num) for i in range(1,1000): if l[i][0] != max_mode: break mode, num = l[i] print(10000-num)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s659569806
p00028
Accepted
l = [0] * 101 while True: try: n = int(raw_input()) l[n] += 1 except EOFError: break max_num = max(l) for i in range(1, 101): if l[i] == max_num: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s232834153
p00028
Accepted
numdict = dict() while True: try: num = input() if num not in numdict: numdict[num] = 0 else: numdict[num] += 1 except EOFError: break most = max(numdict.values()) mostlist = list() for key in numdict: if most == numdict[key]: mostlist.append(int(key)) mostlist.sort() for item in mostlist: print(item)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s352831169
p00028
Accepted
a = [] while True: try: a.append(int(input())) except: break num = [a.count(i + 1) for i in range(100)] for i in range(100): if num[i] == max(num): print(i + 1)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s036507830
p00028
Accepted
n = [0] * 101 while 1: try: n[input()] += 1 except: break m = [i for i, x in enumerate(n) if x == max(n)] for i in m: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s735179446
p00028
Accepted
import sys from collections import Counter C = Counter(int(line.rstrip()) for line in sys.stdin) m = max(C.values()) for k in sorted(C.keys()): if C[k] == m: print k
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s660888061
p00028
Accepted
import sys import collections l = [] for line in sys.stdin: l.append(int(line)) counted = collections.Counter(l).most_common() maxv = counted[0][1] for k, v in counted: if v == maxv: print(k) else: break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s572138074
p00028
Accepted
import sys import collections l = [] for line in sys.stdin: l.append(int(line)) counted = collections.Counter(l).most_common() maxv = counted[0][1] for k, v in counted: if v == maxv: print(k)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s161310124
p00028
Accepted
kosu = [0] * 100 k = 1 while True: try: n = int(input()) kosu[n - 1] += 1 except (EOFError,ValueError): ma = max(kosu) num = kosu.index(ma) + k print(num) kosu.remove(max(kosu)) while True: if ma > max(kosu): break k += 1 num = kosu.index(ma) + k kosu.remove(max(kosu)) print(num) break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s743614006
p00028
Accepted
list=[0]*100 while(True): try: list[int(input())-1]+=1 except: for i in range(100): if list[i]==max(list): print(i+1) break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s874083745
p00028
Accepted
import sys from collections import Counter if __name__ == '__main__': # ??????????????\??? # data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4] data = [] for line in sys.stdin: data.append(int(line.strip())) # print(data) # ?????????????¢???? c = Counter(data) max_freq = c.most_common(1)[0][1] # ???????????????????????°????¨???¶ modes = [] for val, freq in c.most_common(): if freq != max_freq: break modes.append(val) # ???????????¨??? modes.sort() for i in modes: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s357834593
p00028
Accepted
import sys from itertools import dropwhile a = [] for v in sys.stdin: a.append(int(v)) m = max([a.count(v) for v in set(a)]) try: next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m))) except StopIteration: pass
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s280596112
p00028
Accepted
from collections import defaultdict as dd a=dd(int) freq=0 while True: try: b=int(input()) except: break a[b]+=1 if freq<a[b]: freq=a[b] ans=sorted([i for i,j in a.items() if j==freq]) for i in ans: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s202468780
p00028
Accepted
a=[0]*100 while 1: try: n=int(input()) a[n-1]+=1 except: for i in range(100): if a[i]==max(a): print(i+1) break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s046703815
p00028
Accepted
# -*- coding:utf-8 -*- array = [] while True: try: a = int(input()) array.append(a) except EOFError: break data = [0]*101 for i in range(len(array)): data[array[i]] += 1 m = [i for i,j in enumerate(data) if j == max(data)] for i in range(len(m)): print(m[i])
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s109642509
p00028
Accepted
import sys d={} mode=0 while True: n = sys.stdin.readline() if not n: break n = int(n) if d.has_key(n): d[n] = d[n]+1 else: d[n] = 1 if mode < d[n]: mode = d[n] for k in d.keys(): if d[k] == mode: print(k)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s820362381
p00028
Accepted
a=[0]*100 while 1: try:a[int(input())-1]+=1 except:break [print(i+1)for i in range(100)if a[i]==max(a)]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s489485957
p00028
Accepted
import operator h = {} while True: try: i = int(input()) if i in h: h[i] += 1 else: h[i] = 0 except EOFError: break h1=sorted(h.items(),key=operator.itemgetter(1),reverse=1) val = h1[0][1] h2 = sorted(filter(lambda x:x[1]==val, h1)) for i in h2: print(i[0])
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s613686373
p00028
Accepted
import sys counter = [0 for i in range(101)] for n in sys.stdin: n = int(n) counter[n] = counter[n] + 1 m = max(counter) for i in range(101): if counter[i] == m: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s076470238
p00028
Accepted
import sys c=[0 for i in range(101)] for n in sys.stdin: n=int(n) c[n]+=1 m=max(c) for i in range(101): if c[i]==m: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s529399707
p00028
Accepted
import sys c=[0]*101 for n in sys.stdin: n=int(n) c[n]+=1 m=max(c) for i in range(101): if c[i]==m: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s553286789
p00028
Accepted
import sys c=[0]*101 for n in sys.stdin: c[int(n)]+=1 m=max(c) for i in range(101): if c[i]==m: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s143993987
p00028
Accepted
import sys if __name__ == '__main__': nums = [] piles = [0 for i in range(0,101)] for n in sys.stdin: if n == "\n": break else : nums.append(int(n)) for n in nums: piles[n] += 1 maxnum = 0 for p in piles: if maxnum < p: maxnum = p for i,p in enumerate(piles): if maxnum == p: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s371036287
p00028
Accepted
A = [] while True: try: A.append(int(input())) except EOFError: break cnt = [0] * 101 for i in A: cnt [i] += 1 mx = max(cnt) for i in range(1,101): if cnt [i] == mx: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s722797976
p00028
Accepted
import sys from collections import defaultdict d = defaultdict(int) for i in sys.stdin: d[int(i)] +=1 m = max(v for v in d.values()) for i in sorted([k for k, v in d.items() if v == m]): print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s924565101
p00028
Accepted
ans = [0]*101 while True: try: ans[int(input())] += 1 except EOFError: break printqueue = [] maxi = max(ans) for i in range(1,101): if ans[i] == maxi : printqueue.append(i) for elm in printqueue: print(elm)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s507509419
p00028
Accepted
# -*- coding: utf-8 -*- import sys import os import datetime d = {} for s in sys.stdin: v = int(s) if v not in d: d[v] = 1 else: d[v] += 1 max_value = max(d.values()) for key in d.keys(): if d[key] == max_value: print(key)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s546229065
p00028
Accepted
cnt = [] for i in range(0, 101): cnt.append(0) while True: try: n = int(raw_input()) cnt[n] += 1 except: break tmp = 0 lst = [] for i in range(1, 101): if tmp < cnt[i]: tmp = cnt[i] lst = [i] elif tmp == cnt[i]: lst.append(i) for i in range(0, len(lst)): print lst[i]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s482413586
p00028
Accepted
import sys from collections import Counter v = Counter([int(i) for i in sys.stdin.readlines()]).most_common() j = [print(i) for i in sorted([k for k, l in v if l == v[0][1]])]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s185277899
p00028
Accepted
import sys d = {i:0 for i in range(1, 101)} for n in sys.stdin: if n == "\n": break else: d[int(n)] += 1 sort = sorted(d.items(), key=lambda x: x[1], reverse=True) mode = sort[0] for n in sort: if mode[1] == n[1]: print(n[0])
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s736398779
p00028
Accepted
import sys a = {} ma = 0 m = [] for u in sys.stdin: i = int(u) if not (i in a): a[i] = 1 else: a[i] += 1 # ???????????§????????±??? if ma <= a[i]: if ma < a[i]: ma = a[i] m.clear() m.append(i) m = sorted(m) for k in m: print(k)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s437483195
p00028
Accepted
a = [0] * 101 while True: try: a[int(input())] += 1 except: break maxv = max(a) for i, v in enumerate(a): if maxv == v: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s747075038
p00028
Accepted
# Aizu Problem 0028: Mode Value # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") counts = {} while True: try: a = int(input()) except EOFError: break counts[a] = counts.get(a, 0) + 1 for a in sorted([a for a in counts if counts[a] == max(counts.values())]): print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s716987253
p00028
Accepted
import sys def ModeValue(): mode=[0 for i in range(0,101)] for n in sys.stdin: mode[int(n)]+=1 maxN=max(mode) for i in range(0,101): if mode[i]==maxN: print(i) ModeValue()
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s259054784
p00028
Accepted
d={} try: while True: n=int(input()) if n in d: d[n]+=1 else: d[n]=1 except EOFError: pass a=[] m=max(d.values()) for key, value in d.items(): if value == m: a.append(key) a.sort() for i in a: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s647114703
p00028
Accepted
d={} try: while True: n=int(raw_input()) if n in d: d[n]+=1 else: d[n]=1 except EOFError: pass a=[] m=max(d.values()) for key, value in d.items(): if value == m: a.append(key) a.sort() for i in a: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s563618066
p00028
Accepted
import sys nums = map(int, sys.stdin) counter = [0 for i in range(101)] for n in nums: counter[n] += 1 m = max(counter) for i in range(101): if m == counter[i]: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s358681655
p00028
Accepted
# 0028 import collections array = [0]*100 i = 0 while True: try: a = input() array[i] = int(a) i += 1 except EOFError: break array = filter(lambda a: a != 0, array) counter = collections.Counter(array).most_common() for a, count in counter: if count < counter[0][1]: break print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s833675228
p00028
Accepted
# 0028 array = [] while True: try: a = input() if a == '': break array.append(int(a)) except EOFError: break count = list(map(lambda a: array.count(a), set(array))) modes = list(filter(lambda a: array.count(a) == max(count), set(array))) print(*modes, sep = '\n')
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s514695273
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break count = list(map(lambda a: array.count(a), set(array))) modes = list(filter(lambda a: array.count(a) == max(count), set(array))) print(*modes, sep = '\n')
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s046003800
p00028
Accepted
# 0028 array = [] while True: try: a = input() if a == '': break array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), set(array)))) for a in sorted(s): if array.count(a) == mx: print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s638647538
p00028
Accepted
# 0028 array = [] while True: try: a = input() if a == '': break array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) for a in sorted(s): if array.count(a) == mx: print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s675153095
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) for a in sorted(s): if array.count(a) == mx: print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s085079943
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(list(map(lambda a: array.count(a), s))) modes = list(filter(lambda a: array.count(a) == mx, sorted(s))) print(*modes, sep = '\n')
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s218585695
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) count= list(map(lambda a: array.count(a), s)) mx = max(count) modes = list(list(s)[i] for i, x in enumerate(count) if x == mx) print(*sorted(modes), sep = '\n')
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s920101282
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) count= list(map(lambda a: array.count(a), s)) mx = max(count) modes = list(list(s)[i] for i, x in enumerate(count) if x == mx) print(*modes, sep = '\n')
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s474790873
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = array.count(max(array, key = array.count)) for a in sorted(s): if array.count(a) == mx: print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s332191979
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = array.count(max(s, key = array.count)) for a in sorted(s): if array.count(a) == mx: print(a)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s008857795
p00028
Accepted
# 0028 array = [] while True: try: a = input() array.append(int(a)) except EOFError: break s = set(array) mx = max(sorted(s, reverse=True), key = array.count) for a in sorted(s, key = array.count, reverse=True): print(a) if a == mx: break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s569853290
p00028
Accepted
import sys if __name__ == '__main__': a = [0]*101 for tmp_line in sys.stdin: n = (int)(tmp_line) a[n-1] += 1 b = [i+1 for i,x in enumerate(a) if x == max(a)] b.sort() for x in b: print(x)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s054483991
p00028
Accepted
num = [0] * 100 mode = 0 while True: try: a = int(input()) num[a-1] += 1 if num[a-1] > mode: mode = num[a-1] except: break for i, n in enumerate(num): if n == mode: print(i+1)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s495718660
p00028
Accepted
seisuu = [0] * 100 try: while True: a = input() seisuu[a] += 1 except: b = max(seisuu) for i in range(100): if b == seisuu[i]: print i
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s310395420
p00028
Accepted
lis=[0 for i in range(100)] while True: try: x= int(input()) lis[x-1]+=1 except : break ma=max(lis) for i in range(100): if ma==lis[i]: print(i+1)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s498973450
p00028
Accepted
from sys import stdin from collections import Counter data = Counter([i for i in range(1, 101)]) for line in stdin: data[int(line.replace('\n', ''))] += 1 mode = data.most_common(1)[0][1] for po in range(1, 101): if data[po] == mode: print(po) else: pass
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s415209913
p00028
Accepted
import sys d = {i:0 for i in range(1,101)} for i in map(int, sys.stdin): d[i] += 1 s = sorted(d.items(), key=lambda x: x[1], reverse=True) m = s[0][1] for i in s: if i[1] < m: break print(i[0])
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s818850147
p00028
Accepted
import sys data = [0] * 101 for line in sys.stdin: try: n = int(line) data[n] += 1 except: break m = max(data) for i in range(len(data)): if data[i] == m: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s613388576
p00028
Accepted
def main(): Array = [0]*100 while True: try: Array[int(input())-1] += 1 except EOFError: break [print(i+1) for i in range(100) if Array[i] == max(Array)] if __name__ == '__main__': main()
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s897917745
p00028
Accepted
import sys l = [] for input in sys.stdin: l.append(int(input)) l = sorted(l) d = {} for i in range(0,len(l)): d[l[i]] = l.count(l[i]) max = 0 for key,value in d.items(): if(value > max): max = value for key,value in d.items(): if(value == max): print key
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s960456942
p00028
Accepted
a = {} while True: try: a_i = int(input()) if a_i in a: a[a_i] += 1 else: a[a_i] = 1 except: break mode_count = max(a.values()) b = [] for key, value in a.items(): if value == mode_count: b.append(key) print(*sorted(b),sep="\n")
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s930053433
p00028
Accepted
a = {} while True: try: a_i = int(input()) if a_i in a: a[a_i] += 1 else: a[a_i] = 1 except: break mode_count = max(a.values()) b = [] for key, value in a.items(): if value == mode_count: b.append(key) print(*sorted(b),sep="\n")
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s094814719
p00028
Accepted
count = [0 for i in range(100)] while True: try: count[int(input()) - 1] += 1 except: break max_e = 0 max_i = [] for i in range(100): temp = max_e max_e = max(count[i], max_e) if temp == max_e and count[i] == max_e: max_i.append(i + 1) elif temp != max_e: max_i = [i + 1] for i in max_i: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s623382439
p00028
Accepted
a = [] while True: try: a.append(int(input())) except:break c=[0]*101 for i in a: c[i] += 1 b=max(c) for j in range(100): if c[j]==b: print(j)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s296583983
p00028
Accepted
def get_input(): while True: try: yield ''.join(input()) except EOFError: break N = list(get_input()) maxi = 0 nums = [0 for i in range(101)] for l in range(len(N)): k = int(N[l]) nums[int(N[l])] += 1 maxi = max(maxi, nums[k]) for i in range(101): if nums[i] == maxi: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s095958758
p00028
Accepted
import sys a={} for i in sys.stdin: a.setdefault(i,0);a[i]+=1 for k in a: if a[k]==max(a.values()):print(k.strip())
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s372860500
p00028
Accepted
import sys a={} for i in sys.stdin:a.setdefault(i,0);a[i]+=1 for k in a: if a[k]==max(a.values()):print(k.strip())
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s470288996
p00028
Accepted
import sys a={} for i in sys.stdin:a.setdefault(i,0);a[i]+=1 [print(k.strip())for k in a if a[k]==max(a.values())]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s942431750
p00028
Accepted
import sys a=[0]*101 for i in sys.stdin:a[int(i)]+=1 [print(i)for i in range(101)if a[i]==max(a)]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s759844560
p00028
Accepted
# coding: utf-8 import sys d = {} for line in sys.stdin: s = line.strip() if not s in d: d[s] = 1 else: d[s] += 1 max_num = max(d.values()) ans = [int(key) for key, value in d.items() if value == max_num] for i in sorted(ans): print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s287522899
p00028
Accepted
a=[0]*100 while 1: try: a[int(input())-1]+=1 except: break [print(i+1) for i in range(100) if a[i]==max(a)]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s827066964
p00028
Accepted
from collections import Counter import sys lines = [] for line in sys.stdin: lines.append(int(line.strip())) c = Counter(lines) m = c.most_common(1)[0][1] for k in sorted(c.keys()): if c[k]==m: print(k)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s589265632
p00028
Accepted
import sys s ,v = [], [] for e in sys.stdin: try: v[s.index(int(e))] += 1 except: s.append(int(e)) v.append(1) c = list(zip(s, v)) c.sort() c.sort(key = lambda x: x[1], reverse = True) for i in c: if i[1] == c[0][1]:print(i[0]) else:break
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s253198808
p00028
Accepted
import sys,collections l=[int(t) for t in sys.stdin] m=sorted(collections.Counter(l).values())[-1] [print(i[0]) for i in sorted(collections.Counter(l).items(),key=lambda x:x[0]) if i[1]==m]
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s687617374
p00028
Accepted
from collections import Counter dic = Counter() while True: try: dic[int(input())] += 1 except EOFError: break lst = dic.most_common() max_value = lst[0][1] mode_values = [t[0] for t in lst if t[1] == max_value] mode_values.sort() for v in mode_values: print(v)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s609689093
p00028
Accepted
# AOJ 0028 Mode Value # Python3 2018.6.13 bal4u import sys cnt = [0 for i in range(101)] max = 0 for _ in sys.stdin: i = int(_) cnt[i] += 1 if cnt[i] > max: max = cnt[i] for i in range(101): if cnt[i] == max: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s491064945
p00028
Accepted
# AOJ 0028 Mode Value # Python3 2018.6.13 bal4u import sys cnt = [0]*101 while True: try: cnt[int(input())] += 1 except EOFError: break max = max(cnt) for i in range(101): if cnt[i] == max: print(i)
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s157955738
p00028
Accepted
lst = [0]*100 while True: try: n = input() except EOFError: break lst[n-1] += 1 M = max(lst) for i in range(0,100): if lst[i] == M: print i+1
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>
s734974584
p00028
Accepted
import sys dictionary = dict() for line in sys.stdin.readlines(): line = line.strip() num = int(line) if not dictionary.has_key(num): dictionary[num] = 0 dictionary[num] += 1 lastValue = max(dictionary.values()) for key, value in sorted(dictionary.items(), key=lambda x: x[1], reverse=True): if value == lastValue: print key
5 6 3 5 8 7 5 3 9 7 3 4
3 5
<h1>Mode Value</h1> <p> Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. </p> <H2>Input</H2> <p> A sequence of integers <var>a<sub>i</sub></var> (1 &le; <var>a<sub>i</sub></var> &le; 100). The number of integers is less than or equals to 100. </p> <H2>Output</H2> <p> Print the mode values. If there are several mode values, print them in ascending order. </p> <H2>Sample Input</H2> <pre> 5 6 3 5 8 7 5 3 9 7 3 4 </pre> <H2>Output for the Sample Input</H2> <pre> 3 5 </pre> <p> For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5. </p>