Problem:


Score : 200 points

Problem Statement

An X-layered kagami mochi (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.

Lunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?

Constraints

1 ≤ N ≤ 100

1 ≤ d_i ≤ 100

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
d_1
:
d_N

Output

Print the maximum number of layers in a kagami mochi that can be made.

Sample Input 1

4
10
8
8
6

Sample Output 1

3

If we stack the mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, we have a 3-layered kagami mochi, which is the maximum number of layers.

Sample Input 2

3
15
15
15

Sample Output 2

1

When all the mochi have the same diameter, we can only have a 1-layered kagami mochi.

Sample Input 3

7
50
30
50
100
50
80
30

Sample Output 3

4



Sample input:
4
10
8
8
6


Sample output:
3

Submission status: Accepted

Solution code:
d = []
for _ in range(int(input())):
    d.append(input())

print(len(set(d)))

Submission status: Accepted

Solution code:
N =int(input())
d_n = set(int(input()) for i in range(N))
print(len(d_n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, d: "List[int]"):
    print(len(list(set(d))))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    d = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, d)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
mochi = []
for i in range(n):
    tmp = int(input())
    if tmp not in mochi:
        mochi.append(tmp)
mochi = sorted(mochi)
print(len(mochi))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc085/tasks/abc085_b
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))

Submission status: Accepted

Solution code:
N = int(input())
ls = []
mochi = 1
for i in range(N):
  ls.append(int(input()))
ls = sorted(ls)
for i in range(N-1):
  if ls[i]<ls[i+1]:
    mochi += 1
print(mochi)

Submission status: Accepted

Solution code:
N=int(input())
print(len(set([int(input()) for _ in range(N)])))

Submission status: Accepted

Solution code:
i=[int(input()) for i in range(0,int(input()))]
print(len(set(i)))

Submission status: Accepted

Solution code:
N = int(input())
d = [int(input()) for _ in range(N)]
d = set(d)

print(len(d))

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    mochis = list(map(int, inputs))
    mochis.sort(reverse=True)
    count = 0
    prev_mochi = -1
    for m in mochis:
        if prev_mochi == -1 or prev_mochi > m:
            count += 1
        prev_mochi = m
    return count


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)

Submission status: Accepted

Solution code:
n=int(input())
d=[0]*n
for i in range(n):
    d[i]=int(input())
print(len(set(d)))

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    d = [int(input().rstrip('\n')) for _ in range(n)]
    d.sort(reverse=True)
    l = 10 ** 10
    cnt = 0
    for i in range(n):
        if d[i] < l:
            cnt += 1
            l = d[i]
    print(cnt)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
N=int(input())
l=[]
for n in range(N):
    l.append(int(input()))
#print(l)
l=sorted(l, reverse=True)
c=1
for r in range(len(l)-1):
    if l[r]>l[r+1]:
        c+=1
print(c)

Submission status: Accepted

Solution code:
n = int(input())
d = []
for _ in range(n):
        d.append(int(input()))
print(len(set(d)))

Submission status: Accepted

Solution code:
N = int(input())
D = [int(input()) for _ in range(N)]
A = [D[0]]
for d in D:
  if d not in A:
    A.append(d)
print(len(A))

Submission status: Accepted

Solution code:
n = int(input())
moti = []
for i in range(n):
    moti.append(int(input()))
print(len(set(moti)))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]
d.sort(reverse=True)

print(len(set(d)))

Submission status: Accepted

Solution code:
#B問題
N = int(input())
d = set()
for i in range(N):
    d.add(int(input()))

print(len(d))

Submission status: Accepted

Solution code:
def bb085():
    n = int(input())
    dn = set()
    for i in range(0, n):
        dn.add(int(input()))
    print(len(dn))

bb085()

Submission status: Accepted

Solution code:
N=int(input())
D=[int(input()) for _ in range(N)]

num = [0]*100
for d in D:
    num[d-1]+=1
ans=0
for n in num:
    if n>0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
s = set()
for i in range(0, int(input())):
    s.add(int(input()))
print(len(s))

Submission status: Accepted

Solution code:
#2019/09/27
N = int(input())
d = [int(input()) for i in range(N)]
print(len(set(d)))

Submission status: Accepted

Solution code:
n = int(input())
diameter = [int(input()) for i in range(n)]
diameter = set(diameter)
diameter = list(diameter)
print(len(diameter))

Submission status: Accepted

Solution code:
n = int(input())
l =[]
for i in range(n):
  d = int(input())
  l.append(d)
print(len(set(l)))

Submission status: Accepted

Solution code:
n=int(input())
b=[0]*100
for i in range(n):
  b[int(input())-1]+=1
c=0
for i in b:
  if i:
    c+=1
print(c)

Submission status: Accepted

Solution code:
n=int(input())
d=[int(input()) for i in range(n)]

se=set()
for i in d:
    se.add(i)
    
print(len(se))

Submission status: Accepted

Solution code:
n=int(input())
d=sorted([int(input()) for i in range(n)])
cnt=1
for i in range(1,n):
    if d[i]>d[i-1]:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))

print(len(set(d)))

Submission status: Accepted

Solution code:
n = int(input())
D = [int(input()) for i in range(n)]
print(len(set(D)))

Submission status: Accepted

Solution code:
N = int(input())
D = set(int(input()) for _ in range(N))
print(len(D))

Submission status: Accepted

Solution code:
n = int(input())
d = []
for i in range (n):
  d+=[int(input())]
print(len(set(d)))

Submission status: Accepted

Solution code:
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))

print(len(set(li)))

Submission status: Accepted

Solution code:
N = int(input())
d = [int(input()) for i in range(N)]
a = 0
b = 0
e = sorted(d)

while b == 0:
    for l in range(N):
        if e[l-1] < e[l]:
            a += 1
        else:
            b += 1

print(a+1)

Submission status: Accepted

Solution code:
n=int(input())
d=[input()for i in range(n)]
print(len(set(d)))

Submission status: Accepted

Solution code:
n = int(input())

a_L = []
for val in range(n):
    a_L.append(int(input()))

a_L = list(set(a_L))
print(len(a_L))

Submission status: Accepted

Solution code:
N = int(input())
num = []
for i in range(N):
    num.append(input())
print(len(set(num)))

Submission status: Accepted

Solution code:
n = int(input())
d = []
for i in range(n):
    d.append(int(input()))
ans = len(set(d))
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
d=[]
for i in range(N):
    d.append(int(input()))
#di=d[i-1]
count=N
d.sort()
for i in range(N-1):
    if d[i]==d[i+1]:
        count-=1
print(count)

Submission status: Accepted

Solution code:
n=int(input())
d=[]
for i in range(n):
    d.append(int(input()))
print(len(set(d)))

Submission status: Accepted

Solution code:
N=int(input())
d=set()
for i in range(N):
  d.add(int(input()))
print(len(d))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]
print(len(list(set(d))))

Submission status: Accepted

Solution code:
n = int(input())

arr = []

for i in range(n):
    k = int(input())
    
    if not k in arr:
        arr.append(k)

print(len(arr))

Submission status: Accepted

Solution code:
n = int(input())
d = sorted(set([input() for _ in range(n)]), reverse=True)

print(len(d))

Submission status: Accepted

Solution code:
n = int(input())
d = [input() for _ in range(n)]
d.sort()
counter = 0
for i in range(n-1):
    if d[i] == d[i+1]:
        counter += 1
print(len(d)-counter)

Submission status: Accepted

Solution code:
N = int(input())
D = set()
for i in range(N):
  D.add(int(input()))

print(len(D))

Submission status: Accepted

Solution code:
N = int(input())
d_list = [int(input()) for i in range(N)]

sorted(d_list)
print(len(list(set(sorted(d_list)))))

Submission status: Accepted

Solution code:
n = int(input())

S = []
for _ in range(n):
    S.append(int(input()))  # S += [input()] とも書ける

#print(S)
S.sort()
#print(S)
#print(set(S))	
print(len(set(S)))
#print(len(S))

Submission status: Accepted

Solution code:
n = int(input())
d = []
for i in range(0,n):
  d.append(int(input()))
d = sorted(d)

out = 0
last = 0
for i in d:
  if last is not i:
    out += 1
  last = i

print(out)

Submission status: Accepted

Solution code:
n=int(input())
kagami=[]
for i in range(n):
    d=input()
    if d not in kagami:
        kagami.append(d)
print(len(kagami))

Submission status: Accepted

Solution code:
N = int(input())
D = [input()  for _ in range(N)]
D.sort()
ans = 1
for i in range(N-1):
  if D[i] != D[i+1]:
    ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:
i = int(input())
S = []
for _ in range(0, i):
    S.append(int(input()))
S.sort(reverse=True)

output = 0
for key, value in enumerate(S):
    if key == 0:
        output += 1
    elif value != S[key-1]:
        output += 1
print(output)

Submission status: Accepted

Solution code:
n=int(input())
d=[int(input()) for _ in range(n)]
d.sort()
cnt=1
for i in range(n-1):
    if(d[i]!=d[i+1]):
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
candidate = []
for _ in range(n):
  x = int(input())
  candidate.append(x)
candidate.sort(reverse=True)
standard = max(candidate)
Answer_list = [standard]
for item in candidate:
  if item < standard:
    Answer_list.append(item)
    standard = item

print(len(Answer_list))
#print(Answer_list)

Submission status: Accepted

Solution code:
n = int(input())

result_set = set()
for i in range(n):
    result_set.add(int(input()))

print(len(result_set))

Submission status: Accepted

Solution code:
n=int(input())
d=[]
for i in range(n):
	di=int(input())
	if di not in d:
		d.append(di)
print(len(d))

Submission status: Accepted

Solution code:
N = int(input())
A = [0]*N
#最大値を記録しておく
m = 0
#答えとなる変数
ans = 0
#重なっている数をカウントする変数
count = 0
#入力を受け付ける
for i in range(N):
    A[i] =  int(input())
A.sort()
for i in range(N):
    if(m<A[i]):
        m =A[i]
    elif(m == A[i]):
        count +=1
ans = N - count
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
arr = set()
for i in range(n):
    arr.add(int(input()))
print(len(arr))

Submission status: Accepted

Solution code:
n=int(input())
print(len(list(set(sorted([int(input()) for i in range(n)])))))

Submission status: Accepted

Solution code:
n = int(input())
L = [int(input()) for _ in range(n)]
print(len(set(L)))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abs/tasks/abc085_b
n = int(input())

d_list = []
for i in range(n):
    d_list.append(int(input()))

print(len(set(d_list)))

Submission status: Accepted

Solution code:
print(len(set(int(input()) for i in range(int(input())))))

Submission status: Accepted

Solution code:
n = int(input())
moch = [int(input()) for i in range(n)]
print(len(set(moch)))

Submission status: Accepted

Solution code:
mochi = set()
N = int(input())
for _ in range(N):
    mochi.add(int(input()))
print(len(mochi))

Submission status: Accepted

Solution code:
N = int(input())
print(len(sorted(list(set([int(input()) for _ in range(N)])))))

Submission status: Accepted

Solution code:
a = int(input())
numbers = [int(input()) for i in range(a)]
numbers = list(set(numbers))
numbers.sort(reverse=True)
count = 0
ans = len(numbers)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d= [input() for i in range(n)]
print(len(set(d)))

Submission status: Accepted

Solution code:
N = int(input())
d = sorted([int(input()) for i in range(N)])
ans = 1

for i in range(1,N):
    if d[i-1] != d[i]:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
d_set = set(int(input()) for _ in range(N))
print(len(d_set))

Submission status: Accepted

Solution code:
N = int(input())

d_set = set()
for _ in range(N):
    d_set.add(int(input()))

d_list = list(d_set)
d_list.sort()

print(len(d_list))

Submission status: Accepted

Solution code:
# 自分の回答
n = int(input())
array = list(map(int, [input() for i in range(n)]))

array.sort()
count = 1

for i in range(n):
    if(i > 0 and array[i] != array[i-1]):
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input().strip())
print(len(set(int(input().strip()) for _ in range(N))))

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in range(n)]
print(len(set(a)))

Submission status: Accepted

Solution code:
def main():

    N = int(input())
    D = []
    for _ in range(N):
        d = int(input())
        D.append(d)
    D = list(set(D))
    D.sort()
    count = 1
    for i in range(len(D) - 1, -1, -1):
        if D[i - 1] < D[i]:
            count += 1
        else:
            break
    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
D = []
for i in range(N):
    D.append(int(input()))
    
print(len(set(D)))

Submission status: Accepted

Solution code:
n = int(input())
print(len(set(input() for _ in range(n))))

Submission status: Accepted

Solution code:
n = int(input())
d = [ int(input()) for _ in range(n)]
dic = {}
for i in d:
    if not i in dic:
        dic[i] = 1
    else:
        dic[i] += 1
print(len(dic.keys()))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for i in range(n)]
d_set = set(d)
print(len(d_set))

Submission status: Accepted

Solution code:
n = int(input())
mochi = []
for i in range(n):
    diameter = int(input())
    mochi.append(diameter)
print(len(set(mochi)))

Submission status: Accepted

Solution code:
n = int(input())
d_list =  sorted(set([int(input()) for _ in range(n)]))

print(len(d_list))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
N = int(input())
d = list()
for _ in range(N):
    d.append(int(input()))

# solve & output
print(len(list(set(d))))

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    d = [int(input()) for _ in range(N)]
    d.sort()

    number_of_steps = 0
    previous_diameter = 0
    for i in range(N):
        if d[i] > previous_diameter:
            number_of_steps += 1
        previous_diameter = d[i]

    print(number_of_steps)

solve()

Submission status: Accepted

Solution code:

def main():
	list1 = []
	n = int(input())
	for i in range(n):
		list1.append(int(input()))
	set1 = set(list1)
	print(len(set1))
 
 
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:

import sys
from collections import deque, defaultdict
import copy
import bisect
#sys.setrecursionlimit(10 ** 9)
import math
import heapq
from itertools import combinations, permutations

import sys
def input():
	return sys.stdin.readline().strip()

N = int(input())
ans = 0
d = defaultdict(int)
for i in range(N):
	di = int(input())
	if d[di] == 0:
		ans += 1
		d[di] += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for i in range(n)]
cnt = 1
d = sorted(d)
for i in range(n-1):
    if d[i+1] > d[i]:
        cnt += 1
    elif d[i+1] < d[i]:
        break
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
d=[]
for i in range(N):
  d.append(int(input()))
print(len(set(d)))

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

bs = []
for i in range(N):
  bs.append(int(input()))
bs = np.array(bs)

ans = len(np.unique(bs))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
arr = []
for i in range(n):
  arr.append(int(input()))
             
print(len(set(arr)))

Submission status: Accepted

Solution code:
n = int(input())
print(len(list(set([int(input()) for _ in range(n)]))))

Submission status: Accepted

Solution code:
N = int(input())

d = []

for i in range(N):
    temp = int(input())
    d.append(temp)

res = list(set(d))

print(len(res))

Submission status: Accepted

Solution code:
n = int(input())
mochis = []
for i in range(n):
    x = int(input())
    if x not in mochis:
        mochis.append(x)
print(len(mochis))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]
ans = set(d)
print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())
d = []
for i in range(n):
    d.append(int(input()))

c = 0
lastSize = 0
while(True):
    if(len(d) != 0):
        np = max(d)
        d.remove(np)
        if(np != lastSize):
            lastSize = np
            c += 1
    else:
        break
print(c)

Submission status: Accepted

Solution code:
N=int(input())
print(len(set(map(int,[input() for i in range(N)]))))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for i in range(n)]
d.sort()
print(len(set(d)))

Submission status: Accepted

Solution code:
N = int(input())
ds = {int(input()) for _ in range(N)}
print(len(ds))

Submission status: Accepted

Solution code:
N = int(input())
d_list = []
count = 0
for i in range(0, N):
    num = int(input())
    if num in d_list:
        count += 1
    else:
        d_list.append(num)
        
    
print(N -count)

Submission status: Accepted

Solution code:
N = int(input())
a = []
for n in range(N):
    a.append(input())
print(len(set(a)))

Submission status: Accepted

Solution code:
n = int(input())
x = sorted([input() for i in range(n)])
l = len(x)
for i in range(0,n-1):
    if x[i] == x[i+1]:
        l -= 1
print(l)

Submission status: Accepted

Solution code:
N = int(input())
d = [int(input()) for i in range(N)]

# print(list(set(d)))
e = list(set(d))
print(len(e))

Submission status: Accepted

Solution code:
n = int(input())
lis = [int(input()) for i in range(n)]
import collections as cl
dic = cl.Counter(lis)
print(len(dic.keys()))

Submission status: Accepted

Solution code:
print(len({int(input()) for x in range(int(input()))}))

Submission status: Accepted

Solution code:
n = int(input())
d = {int(input()) for x in range(n)}
print(len(d))

Submission status: Accepted

Solution code:
a,*b=open(0);print(len(set(b)))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]
d.sort()

v = 0
count = 0
for i in range(n):
    if v < d[i]:
        count += 1
        v = d[i]
print(count)

Submission status: Accepted

Solution code:
import collections

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


kind = collections.Counter(d)


print(len(kind))

Submission status: Accepted

Solution code:
print(len({int(input()) for _ in range(int(input()))}))

Submission status: Accepted

Solution code:
N = int(input())
d = {int(input()) for _ in range(N)}

print(len(d))

Submission status: Accepted

Solution code:
n = int(input()) 
t = [int(input()) for i in range(n)] 
s=set(t)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
d = []
[d.append(int(input())) for x in range(n)]

d = set(d)
print(len(d))

Submission status: Accepted

Solution code:
N = int(input())
d = [int(input()) for i in range(N)]
d =set(d)

print(len(d))

Submission status: Accepted

Solution code:
N = int(input())
mochi = set()
for i in range(N):
	r = int(input())
	mochi.add(r)

print(len(mochi))

Submission status: Accepted

Solution code:
N = int(input())
d = {int(input())}
for _ in range(N - 1):
	d.add(int(input()))
print(len(d))

Submission status: Accepted

Solution code:
N=int(input())
print(len(set(input() for i in range(N))))

Submission status: Accepted

Solution code:
N=int(input())
print(len(set(input() for i in range(N))))

Submission status: Accepted

Solution code:
import sys
N=int(sys.stdin.readline())
print(len(set(sys.stdin.readline() for i in range(N))))

Submission status: Accepted

Solution code:
N = int(input())
ds = sorted([int(input()) for _ in range(N)], reverse=True)
prev, ans = 0, 0
for n in ds:
  if n != prev:
    ans += 1
  prev = n 
print(ans)

Submission status: Accepted

Solution code:
import sys
s=set()
N=int(sys.stdin.readline())
s = set(sys.stdin.readline() for i in range(N))
print(len(s))

Submission status: Accepted

Solution code:
n=int(input())
d=[int(input()) for _ in range(n)]

print(len(set(d)))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
diameters = list(map(int,[input() for i in range(n)]))
ans = 0
ans = len(Counter(diameters))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D = set(list(int(input()) for i in range(N)))
print(len(D))

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]

st = set(d)

print(len(st))

Submission status: Accepted

Solution code:
_,*d=open(0);print(len(set(d)))

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(n):
    l.append(input())

print(len(set(l)))

Submission status: Accepted

Solution code:
N=int(input())

print(len(set([int(input()) for i in range(N)])))

Submission status: Accepted

Solution code:
N = int(input())
D = []
for i in range(N):
    D.append(int(input()))
sorted_D = sorted(D)
print(len(set(sorted_D)))

Submission status: Accepted

Solution code:
N=int(input())
mochi=[]
for i in range(N):
    a=int(input())
    mochi.append(a)
    
mochi_1=set(mochi)
mochi_2=sorted(mochi_1)

print(len(mochi_2))

Submission status: Accepted

Solution code:
N=int(input())
l_1=[]

for i in range(N):
    l_1.append(int(input()))

l=list(set(l_1))
print(len(l))

Submission status: Accepted

Solution code:
n=int(input())
s = []
for _ in range(n):
    s.append(input()) 
print(len(list(set(s))))

Submission status: Accepted

Solution code:
N = int(input())
mochi_init = [int(input()) for i in range(N)]

mochi_set = set(mochi_init)
print(len(mochi_set))