-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtorres.py
49 lines (40 loc) · 1.11 KB
/
torres.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
t = 1
k = 0
dicionario = {}
while True:
try:
n = int(input())
num = input().split()
numbers = [int(i) for i in num]
for numero in numbers:
if numero in dicionario:
dicionario[numero] += 1
else:
dicionario[numero] = 1
for chave, valor in dicionario.items():
if valor > 1:
t += 1
except:
break
#print(n, num, numbers, dicionario)
print(max(dicionario.values()), len(dicionario))
t = 1
k = 0
dicionario = {}
while True:
try:
n = int(input())
num = input().split()
numbers = [int(i) for i in num]
for numero in numbers:
if numero in dicionario:
dicionario[numero] += 1
else:
dicionario[numero] = 1
for chave, valor in dicionario.items():
if valor > 1:
t += 1
except:
break
#print(n, num, numbers, dicionario)
print(max(dicionario.values()), len(dicionario))