submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s890979864
p00028
Accepted
x = [0]*101 while True: try: n = int(input()) x[n] += 1 except: for i in range(101): if x[i] == max(x): 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>
s720175584
p00028
Accepted
l = list([0] * 101) while True: try: a = int(input()) except EOFError: break l[a] += 1 x = max(l) for i in range(1,101): if l[i] ==x: 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>
s230305980
p00028
Accepted
import sys from collections import Counter list=[] while True: try: s = int(input()) list.append(s) except: break c=Counter(list) mode=c.most_common() print(mode[0][0]) max=mode[0][1] i=1 while True: if max==mode[i][1]: max=mode[i][1] print(mode[i][0]) i+=1 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>
s589661239
p00028
Accepted
import collections S = [] while True: try: s = int(input()) S.append(s) except EOFError: break c = collections.Counter(S) k = 0 a = [] if len(S) == 0: pass else: for i in range(len(c)): if c.most_common()[i][1] == c.most_common()[i+1][1]: k += 1 else: break for i in range(k+1): a.append(c.most_common()[i][0]) a.sort() for i in range(len(a)): print(a[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>
s797950787
p00028
Accepted
from collections import Counter l = [] while True: try: a=int(input()) except EOFError: break l.append(a) L = sorted(l) def calculate_mode(L): c = Counter(L) freq_scores = c.most_common() max_count = freq_scores[0][1] modes = [] #出現回数と最大出現回数が等しいかを確認します。 for num in freq_scores: if num[1] == max_count: modes.append(num[0]) return(modes) if __name__ == '__main__': data = L modes = calculate_mode(L) for mode in modes: print(mode)
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>
s597973019
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 j in range(len(n)): k = int(n[j]) nums[int(n[j])] += 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>
s272871535
p00028
Accepted
a=[] while True: try: a.append(input()) except: break n=len(a) m=[0 for i in range(101)] l=0 for j in range(n): k=int(a[j]) m[k]+=1 l=max(l,m[k]) for i in range(101): if m[i]==l: 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>
s315504276
p00028
Accepted
l = [0] * 101 while True: try: n = int(input()) l[n] += 1 except EOFError: break max = max(l) for i in range(101): if l[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>
s721081823
p00028
Accepted
import collections as co a = [] while True: try: n = int(input()) except: break a.append(n) b = co.Counter(a) c = b.most_common() N = c[0][1] maxs =[] for c2 in c: if c2[1] == N: maxs.append(c2[0]) maxs.sort() d = len(maxs) for j in range(d): print(maxs[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>
s249131462
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 i in printqueue: 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>
s069310912
p00028
Accepted
x=[] y=[] z=[] while True: try: n=int(input()) x.append(n) except EOFError: break Counter = [0] * 101 for n in x: Counter[n] += 1 y.append(Counter[n]) # print(n) #print(y) #print(x) y_len=len(y) for i in range(y_len): # print(i,x[i],y[i]) if y[i]==max(y): # print(x[i]) z.append(x[i]) #print(z) z.sort() z_len=len(z) for i in range(z_len): print(z[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>
s432320757
p00028
Accepted
import collections a = [] while True: try: n = int(input()) except EOFError: break a.append(n) if len(a) != 0: b = collections.Counter(a) c = b.most_common() x = c[0][1] d = [] for elem in c: if elem[1] == x: d.append(elem[0]) else: break d.sort() [print(k) for k in d]
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>
s460095081
p00028
Accepted
# coding: utf-8 # Your code here! a = list([0] * 100) while True : try : a[int(input())-1] += 1 except EOFError : break x = max(a) for i in range(100) : if a[i] == x : 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>
s026332416
p00028
Accepted
#50 最頻値 import collections collections.Counter x = [0]*101 while True: try: x[int(input())] += 1 except EOFError: break #EOFErrorになったらbreakする max = max(x) for i in range(101): if x[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>
s429186576
p00028
Accepted
l=[0]*101 while True: try: i=int(input()) l[i]+=1 except: break M=max(l) for j in range(1,101): if l[j]==M: print(j) 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>
s565731497
p00028
Accepted
lst = [0 for i in range(1,101)] while True: try: lst[int(input())]+=1 except: break m=max(lst) for i in range(100): if m==lst[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>
s639224319
p00028
Accepted
import collections import itertools t = [] while True: try: k=int(input()) t.append(k) except EOFError: break counter = collections.Counter(t) mode_v=counter.most_common()[0][-1] it = itertools.takewhile(lambda kv:kv[-1]==mode_v,counter.most_common()) m=(k for k,v in it) [print(i) for i in 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>
s335501163
p00028
Accepted
a = [0] * 101 while True: try: a[int(input())] += 1 except: break for i in range(101): if a[i] == max(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>
s360789638
p00028
Accepted
import sys c = [0]*101 while True: try: c[int(input())] += 1 except EOFError: break max = max(c) for i in range(101): if c[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>
s473644476
p00028
Accepted
#数字の数を求めるためのリストを作成する num_list = [0 for i in range(101)] #"EOFError"がくるまで入力を繰り返し、入力の番号のインデックスを1ふやす try: while True: num_list[int(input())] += 1 except EOFError: #最瀕値の数が出てきた数を変数に代入し最瀕値であれば出力する i = max(num_list) for j in range(1,101): if num_list[j] == i: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>
s797847496
p00028
Accepted
from collections import Counter l=[0]*100 while True: try: x=int(input()) l[x+1]+=1 except: break for i in range(100): if l[i]==max(l): print(i-1) 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>
s368104582
p00028
Accepted
a=[] while True: try: x=int(input()) a.append(x) except: break b=[] for i in range(1,101): y=a.count(i) b.append(y) c=[j for j, v in enumerate(b) if v == max(b)] e=len(c) for h in range(e): print(c[h]+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>
s019729895
p00028
Accepted
l=[0]*101 while True: try: x=int(input()) l[x]+=1 except: max_va=max(l) for i in range(101): if l[i]==max_va: 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>
s739518693
p00028
Accepted
a = [] while True: try: a.append(int(input())) except: break b=[0]*101 for i in a: b[i] += 1 c = max(b) for i in range(100): if b[i] == c: 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>
s552856973
p00028
Accepted
c=[0]*101 while True : try : a=int(input()) c[a]=c[a]+1 except EOFError : break max=max(c) for i in range(101): if c[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>
s367975168
p00028
Accepted
c=[0]*101 while True: try : a=int(input()) c[a]+=1 except EOFError : break max=max(c) for i in range(101): if c[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>
s858714874
p00028
Accepted
a = [] for i in range(100): try: n = int(input()) a.append(n) except: pass M = 0 b = [] for i in range(100): bi = a.count(i) #print(bi) if bi == M: b.append(i) M = bi elif bi > M: b.clear() b.append(i) M = bi for i in range(len(b)): print(b[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>
s555179983
p00028
Accepted
import sys A = [i+1 for i in range(100)] B = [0 for i in range(100)] a = [0 for i in range(100)] for l in sys.stdin: a.append(int(l)) # for i in range(4): # a[i] = int(input()) for x in a: if x in A: B[x-1] += 1 max = max(B) for i in range(100): if B[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>
s408172599
p00028
Accepted
x=[] while True: try: n=int(input()) x.append(n) except: break c=[0]*101 for i in x: 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>
s244913187
p00028
Accepted
x = [] while True: try: n=int(input()) x.append(n) except: break c=[0]*101 for i in x: 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>
s982752034
p00028
Accepted
a = [0] * 100 while True : try : a[int(input())] += 1 except : break x = max(a) for i in range(100) : if a[i] == x : 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>
s704582456
p00028
Accepted
# coding: utf-8 # 50 import collections S = list() for i in range(100): try: S.append(int(input())) except: break A = list() for j in range(len(collections.Counter(S).most_common())): if collections.Counter(S).most_common()[0][1] == collections.Counter(S).most_common()[j][1]: A.append(collections.Counter(S).most_common()[j][0]) A.sort() for z in range(len(A)): print(A[z])
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>
s220940335
p00028
Accepted
#0028 import collections a = list() for i in range(100): try: a.append(int(input())) except: break x = collections.Counter(a).most_common()[0][1] z = collections.Counter(a).most_common()[0][0] l = [] for j in range(len(collections.Counter(a).most_common())): y = collections.Counter(a).most_common()[j][1] v = collections.Counter(a).most_common()[j][0] if x == y: l.append(v) else: break l.sort() for k in range(len(l)): print(l[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>
s427528530
p00028
Accepted
a = [0]*101 while True: try: n = int(input()) a[n] += 1 except: break for i in range(1,101): if a[i] == max(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>
s503047563
p00028
Accepted
# coding: utf-8 # Your code here! l = [0] * 110 while True: try: n = int(input()) l[n] += 1 except EOFError: break m = max(l) for i in range(1, 101): if l[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>
s454297907
p00028
Accepted
while True: try: alist = [] while True: try: a = int(input()) alist.append(a) except: break m = min(alist) M = max(alist) if m<1: break clist = [0] saihin = [0] for i in range(m,M+1,1): c = alist.count(i) if c>clist[0]: del(clist[0]) clist.append(c) del(saihin[0]) if c==clist[0]: saihin.append(i) l = len(saihin) for i in range(l): if saihin==[]: break print(saihin[0]) del(saihin[0]) except: 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>
s592896653
p00028
Accepted
a = [0] * 101 while 1: try: a[int(input())] += 1 except: break m = max(a) for i, v in enumerate(a): if m == 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>
s166596209
p00028
Accepted
y=[0]*100 while True: try: y[int(input())-1]+=1 except: break flag=False for i in range(100)[::-1]: if flag: exit() for j in range(100): if y[j]==i: flag=True print(j+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>
s858441114
p00028
Accepted
mode = [] count = [0 for i in range(100)] while(1): try: n = int(input()) count[n-1] = count[n-1] + 1 except EOFError: max_ = max(count) for i in range(100): if count[i] == max_: mode.append(i+1) for i in mode: 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>
s618808170
p00028
Accepted
N = [] A = [0 for i in range(100)] while True : try : n = int(input()) N.append(n) A[n - 1] += 1 except : break m = max(A) M = [i for i, x in enumerate(A) if x == m] l = len(M) for i in range(l) : print(M[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>
s906605532
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>
s334643713
p00028
Accepted
# 100まで cnt = [0] * 101 while True: try: index = int(input()) cnt[index] += 1 except EOFError: break max = max(cnt) for i in range(100): 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>
s008110835
p00028
Accepted
num = [[0,i+1] for i in range(100)] while True: try: num[int(input())-1][0] += 1 except: num.sort(reverse = True) ans = [] for i in range(100): if num[i][0] == num[0][0]: ans.append(num[i][1]) else: ans.sort() for z in ans: print(z) break 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>
s015281827
p00028
Accepted
L = [0] * 101 while True: try: k = int(input()) L[k] += 1 except EOFError: break max = max(L) for i in range(101): if L[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>
s973228088
p00028
Accepted
list=[] while True: try: x=int(input()) except: break list.append(x) tmp=1 ans=[] for i in range(100): num=0 for l in range(len(list)): if i==list[l]: num+=1 if num>tmp: tmp=num ans=[i] elif num==tmp: ans.append(i) for n in range(len(ans)): print(ans[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>
s124686139
p00028
Accepted
import sys arr = [] for i in range(101): arr.append(0) maxi = 0 for e in sys.stdin: arr[int(e)] += 1 maxi = max(maxi, arr[int(e)]) for i in range(101): if arr[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>
s766170304
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>
s866816899
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>
s278791951
p00028
Accepted
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>
s817715789
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>
s128642751
p00028
Accepted
import sys cnt = [0]*101 while True: try: cnt[int(input())] +=1 except EOFError: break m = max(cnt) for i in range(101): if cnt[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>
s216958911
p00028
Accepted
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>
s812969399
p00028
Accepted
A=[] B=[] C=[] while True: try: A.append(int(input())) except EOFError: break for i in range(len(A)): count=0 for j in range(len(A)): if A[i]==A[j]: count+=1 B.append(count) maxb=max(B) for i in range(len(A)): if B[i]==maxb: if A[i] in C: pass else: C.append(A[i]) C.sort() for i in range(len(C)): print(C[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>
s494461590
p00028
Accepted
# coding=utf-8 ### ### for atcorder program ### import sys import math # math class class mymath: ### pi pi = 3.14159265358979323846264338 ### Prime Number def pnum_eratosthenes(self, n): ptable = [0 for i in range(n+1)] plist = [] for i in range(2, n+1): if ptable[i]==0: plist.append(i) for j in range(i+i, n+1, i): ptable[j] = 1 return plist ### GCD def gcd(self, a, b): if b == 0: return a return self.gcd(b, a%b) ### LCM def lcm(self, a, b): return (a*b)//self.gcd(a,b) ### Mat Multiplication def mul(self, A, B): ans = [] for a in A: c = 0 for j, row in enumerate(a): c += row*B[j] ans.append(c) return ans mymath = mymath() ### output class class output: ### list def list(self, l): l = list(l) #print(" ", end="") for i, num in enumerate(l): print(num, end="") if i != len(l)-1: print(" ", end="") print() output = output() ### input sample #i = input() #N = int(input()) #A, B, C = [x for x in input().split()] #N, K = [int(x) for x in input().split()] #inlist = [int(w) for w in input().split()] #R = float(input()) #A.append(list(map(int,input().split()))) #for line in sys.stdin.readlines(): # x, y = [int(temp) for temp in line.split()] #abc list #abc = [chr(ord('a') + i) for i in range(26)] ### output sample #print("{0} {1} {2:.5f}".format(A//B, A%B, A/B)) #print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi)) #print(" {}".format(i), end="") def get_input(): N = [] while True: try: #N.append(input()) N.append(int(input())) except EOFError: break return N A = get_input() N = [] maxnum = -1 for i in A: count = 0 for j in A: if i == j: count += 1 if maxnum < count: maxnum = count N = [i] elif maxnum == count: N.append(i) N = set(N) N = sorted(N) 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>
s282476537
p00028
Accepted
if __name__ == '__main__': ans = dict() while True: try: n = int(input()) if n not in ans: ans[n] = 1 else: ans[n] += 1 except EOFError: break a = max(ans.values()) A = [] for d in ans: if ans[d] == a: A.append(d) B = sorted(A) 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>
s524416896
p00028
Accepted
a = [0 for i in range(101)] while True: try: n = int(input()) a[n] += 1 except EOFError: break m = 0 for i in range(1, 101): m = max(m, a[i]) for i in range(1, 101): if a[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>
s673727265
p00028
Accepted
data = [0 for _ in range(100)] while True: try: input_data = int(input()) except EOFError: break data[input_data-1] += 1 max_piv = max(data) for i in range(100): if data[i] == max_piv: 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>
s768791605
p00028
Accepted
import sys counter = [] for i in range(0, 101): counter.append(0) for line in sys.stdin: counter[int(line)] += 1 max = 0 for i in range(0, 101): if max < counter[i]: max = counter[i] for i in range(0, 101): if max == 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>
s525868452
p00028
Accepted
a = [0] * 100 while True: try: a[int(input()) - 1] += 1 except: break flag = False for i in range(100)[::-1]: if flag: exit() for j in range(100): if a[j] == i: flag = True print(j + 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>
s958641836
p00028
Accepted
import sys freq = {} for s in sys.stdin: n = int(s.strip()) if n not in freq: freq[n] = 1 else: freq[n] += 1 sortedfreq = sorted(freq.items(), key=lambda x:-x[1]) modes = sorted(filter(lambda x: x[1] == sortedfreq[0][1], sortedfreq), key=lambda x:x[0]) for i in modes: 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>
s688511108
p00028
Accepted
count_map = {} while True: try: i = int(input()) if i in count_map: count_map[i] += 1 else: count_map[i] = 1 except EOFError: break max_count = max(count_map.values()) mode_values = [] for item in count_map.items(): if item[1] == max_count: mode_values.append(item[0]) for mode in sorted(mode_values): print(mode)
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>
s329606981
p00028
Accepted
import collections alist = [] while(1): try: a = int(input()) except: break alist.append(a) ac = collections.Counter(alist) cnt = 0 while(1): print(ac.most_common()[cnt][0]) if cnt == len(alist): break if ac.most_common()[cnt][1] == ac.most_common()[cnt+1][1]: cnt += 1 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>
s740507130
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>
s056422254
p00028
Accepted
import sys i_f = {} for line in sys.stdin: v = int(line) if i_f.get(v) is None: i_f[v] = 0 i_f[v] += 1 ans = {} for i, f in i_f.items(): if ans.get(f) is None: ans[f] = [] ans[f].append(i) ans = [ (a,vs) for a, vs in ans.items() ] ans = max(ans, key=lambda x:x[0]) #print(ans) for i in sorted(ans[1]): 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>
s934525208
p00028
Accepted
from collections import Counter a = [] while(True): try: a.append(int(input())) except: c = Counter(a) d = c.most_common() print("\n".join(str(e[0]) for e in d if e[1] == d[0][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>
s168656042
p00028
Accepted
import sys def solve(): A = [0 for _ in range(101)] for i in sys.stdin: a = int(i) A[a] += 1 M = max(A) for i, a in enumerate(A): if a == M: print(i) if __name__ == "__main__": solve()
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>
s544629219
p00028
Runtime Error
hist = [0 for i in range(100)] l = [] while True: try: hist[input() - 1] += 1 except: break; for k in filter(lambda x: max(hist) == x[1], enumlate(hist)): print k[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>
s257242906
p00028
Runtime Error
import sys count = [0 for _ in range(100)] mode = [0] for s in sys.stdin: x = int(s) count[x-1] += 1 for i in range(len(count)): if count[i] > mode[0]: mode.clear() mode.append(i+1) elif count[i] == mode[0]: mode.append(i+1) for i in 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>
s431059801
p00028
Runtime Error
import sys count = [0 for _ in range(101)] mode = [0] for s in sys.stdin: x = int(s) count[x] += 1 for i in range(len(count)): if count[i] > mode[0]: mode.clear() mode.append(i) elif count[i] == mode[0]: mode.append(i) for i in 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>
s340852889
p00028
Runtime Error
import sys def max(count): m = count[0] for i in range(1,len(count)): if count[i] > m: m = count[i] return m list = [] count = [] mode = 0 for i in range(10): count.append(0) list.append('m') for line in sys.stdin.readlines(): num = int(line) if num not in list: list[num] = num count[num] = count[num] + 1 else: count[num] = count[num] + 1 m = max(count) print("max is",m) for i in range(len(count)): if m == count[i]: print(list[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>
s881167344
p00028
Runtime Error
import sys def max(count): m = count[0] for i in range(1,len(count)): if count[i] > m: m = count[i] return m list = [] count = [] mode = 0 for i in range(10): count.append(0) list.append('m') for line in sys.stdin.readlines(): num = int(line) if num not in list: list[num] = num count[num] = count[num] + 1 else: count[num] = count[num] + 1 m = max(count) for i in range(len(count)): if m == count[i]: print(list[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>
s939834813
p00028
Runtime Error
a, md = [], [] c, mx = 1, 1 while True: try: a.append(int(input())) except EOFError: break a = sorted(a) print(a) for i in range(0, len(a) - 1): if a[i] == a[i + 1]: c += 1 else: c = 1 if mx < c: mx = c md = [a[i]] elif mx == c: md.append(a[i]) print('\n'.join(map(str, sorted(md)))
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>
s981109715
p00028
Runtime Error
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>
s765900581
p00028
Runtime Error
# -*- coding: utf-8 -*- DICT = {k: 0 for k in range(0, 10)} def solve(d): l = [] _max = max(d.values()) for k, v in d.items(): if _max == v: l.append(k) print('\n'.join(l)) 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>
s142397502
p00028
Runtime Error
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)
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>
s615773268
p00028
Runtime Error
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)]) next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == 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>
s191551803
p00028
Runtime Error
# -*- coding:utf-8 -*- import sys array = [] for i in sys.stdin: array.append(int(i)) data = [0]*100 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>
s027611519
p00028
Runtime Error
import sys c=[0 for i in range(101)] for n in sys.stdin: n=int(n) counter[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>
s884876907
p00028
Runtime Error
import sys arr = [0 for i in range(0,101)] for i in sys.stdin: arr[int(i)] += 1 max = max(arr) for i in for(0,101): if arr[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>
s223152813
p00028
Runtime Error
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.value()) for key, value in d: 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>
s432767459
p00028
Runtime Error
# 0028 import collections array = [0]*100 i = 0 while True: a = input() if a == '': break array[i] = int(a) i += 1 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>
s181423045
p00028
Runtime Error
# 0028 import collections array = [0]*100 i = 0 while True: try: array[i] = int(input()) i += 1 except EOFError: break array = filter(lambda a: a != 0, array) max = max(array.count()) print(filter(lambda a: array.count(a) == max, array), 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>
s691692808
p00028
Runtime Error
# 0028 import collections array = [] i = 0 while True: try: array.append(int(input())) i += 1 except ValueError: break count = list(map(lambda a: array.count(a), array)) modes = list(set(filter(lambda a: array.count(a) == max(count), 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>
s322323376
p00028
Runtime Error
# 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>
s284192584
p00028
Runtime Error
# 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))) 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>
s244156714
p00028
Runtime Error
# 0028 array = []*100 i = 0 while True: try: a = input() array[i] = int(a) i += 1 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>
s972441918
p00028
Runtime Error
import sys l = [] c = list([0] * 100) for i in sys.stdin.readlines(): c[int(i)] += 1 m = max(c) for i in xrange(c.count(m)): i = c.index(m) print i + 1 c.pop(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>
s897792455
p00028
Runtime Error
import sys l = [] c = list([0] * 100) for i in sys.stdin.readlines(): c[int(i - 1)] += 1 m = max(c) for i in xrange(c.count(m)): i = c.index(m) print i + 1 c.pop(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>
s205842697
p00028
Runtime Error
d=[0]*101 while True: try: n=input() d[n]+=1 except: break tmp=max(d) for i in range(101): if d[i]=tmp: 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>
s898913857
p00028
Runtime Error
nums = [] val = [] while True: try: nums.append(int(raw_input())) except EOFError: num_list = sorted(list(set(nums))) for n in num_list: val.append(nums.count(n)) ans.append(num_list[val.index(max(val))]) tmp = max(val) val.remove(max(val)) while max(val) == tmp: ans.append(num_list[val.index(max(val))]) val.remove(max(val)) for s in ans: print s 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>
s244285619
p00028
Runtime Error
nums = [] val = [] ans = [] while True: try: nums.append(int(raw_input())) break: num_list = sorted(list(set(nums))) for n in num_list: val.append(nums.count(n)) ans.append(num_list[val.index(max(val))]) tmp = max(val) val.remove(max(val)) num_list.pop(val.index(tmp)) while max(val) == tmp: ans.append(num_list[val.index(max(val))]) num_list.pop(val.index(tmp)) val.remove(max(val)) for s in ans: print s
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>
s409071520
p00028
WA: Presentation Error
# -*- coding: utf-8 -*- DICT = {k: 0 for k in range(1, 101)} def solve(d): l = [] _max = max(d.values()) for k, v in sorted(d.items()): if _max == v: l.append(k) print('\n'.join(str(e) for e in l), end='') 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>
s097767942
p00029
Wrong Answer
a = raw_input().lower() s = a.split() ss = "" tmp = "" n = 0 for i in s: if len(ss) < len(i): ss = "i" for i in s: if a.count(i) > n: n = a.count(i) tmp = i print tmp, ss
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s814618393
p00029
Wrong Answer
# coding: utf-8 # Your code here! a = raw_input().lower() s = a.split() ss = "" tmp = "" n = 0 for i in s: if len(ss) < len(i): ss = i for i in s: i+=" " if a.count(i) > n: n = a.count(i) tmp = i print tmp, ss
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s807565443
p00029
Wrong Answer
# coding: utf-8 # Your code here! a = raw_input().lower() s = a.split() ss = "" tmp = "" n = 0 for i in s: if len(ss) < len(i): ss = i for i in s: i+=" " if a.count(i) > n: n = a.count(i) tmp = i.strip() print tmp, ss
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s423170832
p00029
Wrong Answer
# coding: utf-8 # Your code here! a = raw_input().lower() a = " "+a+" " s = a.split() ss = "" tmp = "" n = 0 for i in s: if len(ss) < len(i): ss = i for i in s: i+=" " if a.count(i) > n: n = a.count(i) tmp = i.strip() print tmp, ss
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s242482360
p00029
Wrong Answer
# coding: utf-8 # Here your code ! l = input().split() len_m = 0 for e in l: if len_m < len(e): len_m = len(e) a1 = e d = {} for e in l: if e not in d: d.update({ e: 1 }) else: t = d[e] d.update({ e: (t+1) }) print('%s %s' % (max(d),a1))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s789004072
p00029
Wrong Answer
import sys f = sys.stdin import collections c = collections.Counter(f.readline().lower().split()) longest = '' for word in c: if len(longest) < len(word): longest = word print(max(c), longest)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s329204919
p00029
Wrong Answer
import sys f = sys.stdin import collections c = collections.Counter(f.readline().split()) longest = '' for word in c: if len(longest) < len(word): longest = word print(max(c), longest)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s590225664
p00029
Wrong Answer
# -*- coding: utf-8 -*- ls = [] dic = {}# {'your' : [出現回数,単語長]} ls = raw_input().split() for k in range(len(ls)): if ls[k] not in dic.keys(): dic[ls[k]] = [] dic[ls[k]].append(1) dic[ls[k]].append(len(ls[k])) else: dic[ls[k]][0] += 1 a=max(dic) # value[0] b=max(dic.items(), key=lambda x: x[1][1])[0] print "%s %s" % (a,b)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>