Problem:


Score : 300 points

Problem Statement

You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.

How many kinds of items did you get?

Constraints

1 \leq N \leq 2\times 10^5

S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print the number of kinds of items you got.

Sample Input 1

3
apple
orange
apple

Sample Output 1

2

You got two kinds of items: apple and orange.

Sample Input 2

5
grape
grape
grape
grape
grape

Sample Output 2

1

Sample Input 3

4
aaaa
a
aaa
aa

Sample Output 3

4



Sample input:
3
apple
orange
apple


Sample output:
2

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()
	S = []
	ans = 0
	for i in range(N):
		tmp = input()
		tmp = tmp[:-1]
		if tmp in S:
			continue
		else:
			S.append(tmp)
			ans += 1



	print(ans)


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
items = []
ans = 0
for _ in range(N):
  item = input()
  if not item in items:
    items += item,
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
for i in range(N):
    S = input()
    if S not in l:
        l.append(S)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
c = 0
for i in range(N):
  s = input()
  if s in l:
    continue
  c+=1
  l.append(s)
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
li = []
for i in range(N):
    a = input()
    if a not in li:
        li.append(a)
print(len(li))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S_list = []
for i in range(N):
  s = str(input())
  if not (s in S_list):
    S_list.append(s)
print(len(S_list))

Submission status: Time Limit Exceeded

Solution code:
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
 
n = aint()
get = []
for i in range(n):
  s = input()
  if s not in get:
    get.append(s)
print(len(get))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

counter = []

for i in range(N):
    si = input()
    if si not in counter:
        counter.append(si)

print(len(counter))

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
aa = []
for i in range(a):
    n = input()
    if aa.count(n) == 0:
        aa.append(n)
print(len(aa))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
items = []
cnt = 0
for i in range(N):
    item = input()
    if item not in items:
        items.append(item)
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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


for i in range(N):
  S = input()
  if S in arr:
    a = 0
  else:
    arr.append(S)
    
print(int(len(arr)))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
k=0
for i in range(n):
    s=input()
    if s not in a:
        k+=1
        a.append(s)
print(k)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
    s=input()
    if s not in a:
        a.append(s)

print(len(a))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lis = []
for i in range(N):
    s = input()
    if not s in lis:
        lis.append(s)
print(len(lis))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
count=0
s=[]
for i in range(N):
  a=input()
  if(a not in s):
    count+=1
    s.append(a)
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
input_list = []
for i in range(n):
    s = input()
    if s in input_list: continue
    input_list.append(s)
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []

for i in range(n):
    w = input()
    if w not in l:
        l.append(w)

print(len(l))

Submission status: Time Limit Exceeded

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

for i in range(N):
    s=input()
    if s in ans:
        pass
    else:
        ans.append(s)

print(len(ans))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
arr = []
ans = 0
for i in range(n):
    s = str(input())
    if s not in arr:
        arr.append(s)
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

S=[]

for i in range(N):
    a=input()
    if S.count(a) == 0:
        S.append(a)

print(len(S))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

s=[]
cnt=0

for i in range(n):
  a=str(input())
  if a in s:
    continue

  else:
    s.append(a)
    cnt+=1

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = [input() for i in range(N)]
l2 = []
ans = 0
for a in l:
    if a not in l2:
        ans+=1
        l2.append(a)
    else:
        pass
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
l=[]
for i in range(N):
    S=input()
    if S not in l:
        l.append(S)
print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
gacha = []

for i in range(N):
    tmp = input()
    if tmp in gacha:
        continue
    else:
        count += 1
        gacha.append(tmp)
        

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

S = []
cnt = 0
for n in range(N):
  temp = input()
  if not (temp in S):
    S.append(temp)
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
l=list()
for i in range(int(input())):
    s=input()
    if s not in l:
        l.append(s)
print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []
cnt = 0
for i in range(n):
    s = input()
    if s not in l:
        cnt += 1
        l.append(s)
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

unique_list = list()
for _ in range(n):
    s = input()
    if s not in unique_list:
        unique_list.append(s)

print(len(unique_list))

Submission status: Time Limit Exceeded

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

count=0
s=[]
for i in range(N):
  if(S[i] not in s):
    count+=1
    s.append(S[i])
print(count)

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    n=int(input())
    b=[]
    k=1
    ans=0
    for i in range(n):
        a=input()
        for j in b:
            if j==a:
                k=0
        ans+=k
        k=1
        b.append(a)
    print(ans)
resolve()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
get = []
count = 0
for i in range(n):
    prize = input()
    if prize in get:
        continue
    get.append(prize)
    count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = []

for _ in range(N):
    S = input()
    if S not in ans:
        ans.append(S)

print(len(ans))

Submission status: Time Limit Exceeded

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

ans = []
for i in range(n):
    if not s[i] in ans:
        ans.append(s[i])

print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = []
for i in range(N):
    S = input()
    if S not in L:
        L.append(S)
print(len(L))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
D = []
ans = 0

for _ in range(N):
    S = input()
    if S not in D:
        D.append(S)
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
t=int(input())
l=[]
ct=0
for k in range(t):
    s=str(input())
    if(s not in l):
        l.append(s)
        ct+=1
print(ct)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import math
n = int(input())
a = []
for i in range(n):
    s = str(input())
    if not s in a:
        a.append(s)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
nb = int(input())
l = []
for i in range(nb):
  el = input()
  if el not in l:
    l.append(el)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=[]
for i in range(N):
  a=input()
  if(a not in S):
     S.append(a)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = []
count = 0
for _ in range(n):
    i = input()
    if not i in lis:
        count += 1
        lis.append(i)
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ss =[]
num = 0

for i in range(n):
    s = input()
    if s not in ss:
        ss.append(s)
        num += 1

print(num)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = []

for i in range(n):
    s = input()
    if s not in lst:
        lst.append(s)

print(len(lst))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = set()
count = 0
for _ in range(N):
    s = input()
    S.add(s)
print(len(S))

Submission status: Accepted

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

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())
#リスト内包表記
Ss = [input() for _ in range(N)]
Ss_set = set(Ss)
print(len(Ss_set))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
    s = input()
    d[s] = d.get(s, 0) + 1
print(len(d))

Submission status: Accepted

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

Submission status: Accepted

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

s = set(s)
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())

string = [input() for i in range(n)]

string.sort()

i = Counter(string)

print(len(i))

Submission status: Accepted

Solution code:
import sys

N = int(input())
reward = set()
for i in range(N):
    S = input()
    reward.add(S)

print(len(reward))

Submission status: Accepted

Solution code:
# C
from collections import Counter

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

counter = Counter(S)

print(len(counter.keys()))

Submission status: Accepted

Solution code:
n = int(input())

ans = []

for i in range(n):
    ans.append(input())

print(len(set(ans)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

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

S = Counter(S)
print(len(S))

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())
dic = {}
ans = 0

for _ in range(n):
  x = input()
  if x not in dic:
    ans += 1
    dic[x] = 1


print(ans)

Submission status: Accepted

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

print(len(set(S)))

Submission status: Accepted

Solution code:
N = int(input())

s = set([])
for i in range(N):
    str_ = input()
    s.add(str_)

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

mono = []

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

print(len(set(mono)))

Submission status: Accepted

Solution code:
N = int(input())
s = [0] * N

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


d = set()
for v in s:
    d.add(v)

print(len(d))

Submission status: Accepted

Solution code:
N=int(input())
s=set()
for _ in range(N):
    S=input()
    s|={S}
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
myset = set([])
for i in range(N):
  S = input()
  myset.add(S)
print(len(myset))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = {}
for i in range(n):
    s = input()
    if s not in a:
        a[s] = 1
    else:
        a[s] += 1
print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

strs = set()

for _ in range(N):
    strs.add(input())

print(len(strs))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = set()
for i in range(0, n):
    lst = input()
    a.add(lst)

print(len(a))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input() for _ in range(n))
keihin = set()
for i in s:
    keihin.add(i)
print(len(keihin))

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
S=[input() for _ in [0]*N]
print(len(Counter(S).items()))

Submission status: Accepted

Solution code:
import numpy as np

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

data_list = np.array(data_list)
print(len(np.unique(data_list)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = [str(input()) for i in range(N)]
gocha = {}
for s in S:
  gocha[s] = 1
print(len(gocha))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(len(S))

Submission status: Accepted

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

T = set(S)
print(len(T))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

Solution code:
N = int(input())

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

prise = list(set(prise))
print(len(prise))

Submission status: Accepted

Solution code:
N = int(input())
S = [None] * N
for i in range(N):
    S[i] = input()

S = set(S)
print(len(S))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input() for _ in range(n))

print(len(list(set(s))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
b=[]
c=[]
for j in range(N):
    a = input()
    b.append(a)



c = set(b)

print(len(c))

Submission status: Accepted

Solution code:
N = int(input())

D =[]

for i in range(N):
    S = input()
    D.append(S)
    
#print(D)

#print(set(D))
print(len(set(D)))

Submission status: Accepted

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


def solve(N: int, S: "List[str]"):
    return len(set(S))


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    answer = solve(N, S)
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
from collections import defaultdict
dic = defaultdict(int)
for _ in range(n):
    tmp = input()
    dic[tmp] += 1
print(len(dic))

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    a = set()
    for i in range(n):
        s = input()
        a.add(s)
    print(len(a))
        

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

S = set(S)
S = list(S)


print(len(S))

Submission status: Accepted

Solution code:
import sys

N = int(input())
S = set()
for i in range(N):
    S.add(str(input()))


print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(len(set(s)))

Submission status: Accepted

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

from collections import Counter

c = Counter(str_list)
print(len(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - gacha

n = int(input())
s = []
c = 1

for i in range(n):
    s.append(input())

s.sort()

for j in range(1,n):
    if s[j-1] != s[j]:
        c += 1


print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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



print(len(set(a)))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    counter = set()
    for i in range(N):
        s = input()
        counter.add(s)
    print(len(counter))


main()

Submission status: Accepted

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

l = set(l)
print(len(l))

Submission status: Accepted

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

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())

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

Submission status: Accepted

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

types = set(s)
print(len(types))

Submission status: Accepted

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

s.sort()

ans = n
for i in range(n-1):
    if s[i] == s[i+1]:
        ans -= 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

m = {}
for i in range(n):
  s = input()
  m[s] = True
  
print(len(m))

Submission status: Accepted

Solution code:
import collections

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

c = collections.Counter(S)
print(len(c))

Submission status: Accepted

Solution code:
n = int(input())

s = []

for x in range(n):
  mozi = input()
  s.append(mozi)
  
new_s = set(s)

print(len(new_s))

Submission status: Accepted

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

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

S = set(S)
ans = len(S)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

slist = []
for i in range(N):
  slist.append(input())
print (len(set(slist)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

l = []

N = int(input())

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

c = Counter(l)
print(len(c))

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
for _ in range(n):
  dic[input()] = 0
print(len(dic))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=[input() for i in range(a)]
b.sort()
c=0
for i in range(a-1):
  if b[i]==b[i+1]:
    c=c+1
print(a-c)

Submission status: Accepted

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

print(len(set(S)))

Submission status: Accepted

Solution code:
N = int(input())
d = dict()
for i in range(N):
  prize = input()
  if not prize in d:
    d[prize] = 1
print(len(d))

Submission status: Accepted

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

s=set(s)

print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
b=0
S=[]

for i in range(0,N):
    S.append(input())
b=Counter(S)
print(len(b))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(input())
    S = {'0'}
    for i in range(N):
        S.add(input())
    print(len(S) - 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

s = set()


for i in range(n):
    s.add(input())

print(len(s))

Submission status: Accepted

Solution code:
N = int(input())
li = list()
for i in range(N):
    li.append(input())

print(len(list(set(li))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(len(list(set(S))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = [input() for i in range(N)]
S.sort()
cnt = 1
for i in range(1, N):
    if S[i]!=S[i-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#C
N=int(input())
S=list(input() for i in range(N))

print(len(list(set(S))))

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    s_dict = dict()
    for _ in range(n):
        s = input()
        if s in s_dict:
            continue
        else:
            s_dict[s] = 1

    print(sum(s_dict.values()))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    s = set()
    for _ in range(n):
        s.add(input())

    print(len(s))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


N = I()
S = [_S() for _ in range(N)]
ans = 0

s = set()

for i in range(N):
    s.add(S[i])

ans = len(s)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
s = [0]*x

for i in range(x):
  s[i-1] = input()

l = set (s)
length = len(l)

print(length)

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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