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: Accepted

Solution code:
def main():
    n = int(input())
    s = [input() for i in range(n)]
    import numpy as np
    s = np.unique(s)
    print(len(s))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

S = sorted(S)
for i in range(N-1):
    if S[i] == S[i+1]:
        counter += 1
print(N - counter)

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline())
data = sys.stdin.readlines()
L = [x.strip("\n") for x in data]
print(len(list(set(L))))

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:

import sys
input = sys.stdin.readline

N = int(input())
s = set()

for i in range(N):
   strA = str(input())
   s.add(strA)

print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
res = [input() for i in range(n)]
res_ = list(set(res))

print(len(res_))

Submission status: Accepted

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

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_input = int(input())

# print(N_input)

str = set()
for i in range(N_input):
    str.add(input())
print(len(str))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

freebies_list = [input() for i in range(N)]
freebies_set = set(freebies_list)

print(len(freebies_set))

Submission status: Accepted

Solution code:
n = int(input())
li = []
count = 0
for i in range(n):
    li.append(input())
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        count += 1
print(n-count)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
l=[input() for i in range(n)]
c=Counter(l)
print(len(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
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())
tList = []
for i in range(N):
    A = input()
    tList.append(A)
print(len(set(tList)))

Submission status: Accepted

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

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

Acquisition_unique=list(set(Acquisition))
print(len(Acquisition_unique))

Submission status: Accepted

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

S.sort()

for i in range(0, N - 1):
    if S[i] == S[i+1]:
        count += 1

ans = len(S) - count
print(str(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    print(len(set(S)))

main()

Submission status: Accepted

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

for i in range(N):
    item=input()
    goods.append(item)

print(len(list(set(goods))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
d=dict()

for i in range(n):
  s="".join(input())
  #print(s)
  if s in d:
    d[s]+=1
  else:
    d[s]=1
ans=0
for x in d.values():
  ans+=1
print(ans)

Submission status: Accepted

Solution code:

N = int(input())

m = {}
for i in range(N):
    l = input()
    m[l] = ""

print(len(m))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
freebies={}
count=0

for i in range(N):
    S=input()
    if not S in freebies:
        freebies[S]=True
        count+=1

print(count)

Submission status: Accepted

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

cnt = len(set(s))
if cnt <= n:
    print(cnt)
else:
    print(n)

Submission status: Accepted

Solution code:
N = int(input())

presents = []

for i in range(N):
    present = input()
    presents.append(present)
print(len(set(presents)))

Submission status: Accepted

Solution code:
import collections

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

for i in range(N):
  S_list.append(input())
  
c = collections.Counter(S_list)
print(len(c))

Submission status: Accepted

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

cnt = 1
S = sorted(S)
s_1 = S[0]
for s in S[1:]:
    if s_1 != s:
        cnt += 1
        s_1 = s

print(cnt)

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())
Set = set()
for i in range(N):
    S=input()
    Set.add(S)

print(len(Set))

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())
mdic={}
for i in range(0,n):
  st=input()
  mdic[st]=i+1
print(len(mdic))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections

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

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

Submission status: Accepted

Solution code:
import collections
print(len(collections.Counter([input() for i in range(int(input()))])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
N = int(input())
S = [str(input()) for _ in range(N)]
c=collections.Counter(S)
print(len(c))

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:
num=int(input())
s = [input() for i in range(num)]
print(len(set(s)))

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
n = int(input())
s = [input() for _ in range(n)]
d = {}
total=0
for i in s:
    d[i]= 1
    
for key in d.keys():
    total+=1
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

N = int(input())

List = [input() for i in range(N)]

c = collections.Counter(List)

print(len(c))

Submission status: Accepted

Solution code:
import collections
n = int(input())
s = [input() for i in range(n)]
print(len(collections.Counter(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
dict = {}

while cnt < n:
    s = input()
    dict[s] = True
    cnt += 1

res = 0
for i in dict:
    res += 1

print(res)

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:
def abc(N, S):
    # 答えの準備
    ans = 0
    
    # 集合
    str_set = set(S)
    
    # 答え
    return(len(str_set))


# バッチスタート
if __name__ == "__main__":
    # 標準入力処理
    # 1行目の入力を数値として扱う
    N = int(input())
    
    # N回入力
    S = []
    for i in range(0, N):
        s = input()
        S.append(s)
    
    # 関数呼び出し
    f = abc(N, S)
    
    # 答えの出力
    print(f)

Submission status: Accepted

Solution code:
n = int(input())

s = []
for i in range(n):
    x = str(input())
    s.append(x)


s.sort()

cnt = 1
if n == 1:
    print(1)
else:
    for i in range(n-1):
        if not (s[i] == s[i + 1]):
            cnt += 1
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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());
A=[]
for i in range(N):
  B=input()
  A.append(B)
A=list(set(A))
print(len(A))

Submission status: Accepted

Solution code:
n = int(input())
#a,b = map(int,input()split())
#L = list(map(int,input()split()))
L = set()
for i in range(n):
    L.add(input())
print(len(L))

Submission status: Accepted

Solution code:
# coding: utf-8
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())
S_list = [input() for i in range(N)]

S_set = set(S_list)
print(len(S_set))

Submission status: Accepted

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

c = collections.Counter(l)

print(len(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces

def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('A')+1)
    return num
    
def main():
    n = ni()
    s = set([alpha2num(ns()) for i in range(n)])
    print(len(s))
    return

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(set(li)))

Submission status: Accepted

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

Submission status: Accepted

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

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

s_set = set(s)

print(len(s_set))

Submission status: Accepted

Solution code:
numOfStr= int(input())
strlist = []
total = 1
for i in range(0,numOfStr):
    strlist.append(input())
strlist.sort()
for i in range(1,numOfStr):
    if strlist[i] != strlist[i-1]:
        total += 1
print(total)

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

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

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:
#A,B,C,D=map(int,input().split(" "))

N=int(input())

S=[]
ans=0

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

ans = len(list(set(S)))

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

presents_list = {}

for i in range(n):
    present = input()
    if present in presents_list:
        presents_list[present] += 1
    else:
        presents_list[present] = 1

print(len(presents_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
n=int(input())
A=[]
for i in range(n):
  A.append(input())
c = collections.Counter(A)
print(len(c))

Submission status: Accepted

Solution code:
n = int(input())

cnt = 0
prize_list = []
for i in range(n):
    prize_list.append(input())
    

print(len(set(prize_list)))

Submission status: Accepted

Solution code:
n = int(input())

dic = {}
for i in range(n):
  value =str(input())
  dic[value] = True
  
print(len(dic))

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:
# cook your dish here
li=[]
for _ in range(int(input())):
    li.append(input())
print(len(set(li)))

Submission status: Accepted

Solution code:

# -*- coding: utf-8 -*-
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    d = {}
    for i in S:
        if not(i in d):
            d[i] = 0
            #print(d)
    print(len(d))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(len(list(set(arr))))

Submission status: Accepted

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

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:
import collections

n = int(input())
list = []
for i in range(n):
    s = str(input())
    list.append(s)
c = collections.Counter(list)
print(len(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())

s = [input() for i in range(a)]

s=set(s)

print(len(s))

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:
import collections
n = int(input())
l = []
for i in range(n):
  l.append(input())
c = collections.Counter(l)
num = 0
for i in c.keys():
  num += 1
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input().strip())
S = []
for _ in range(N):
  S.append(input())  # S += [input()] とも書ける
print(len(set(S)))

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
N = int(input())

mylist = []
for i in range(0, N):
  val = input()
  mylist.append(val)
  
print(len(set(mylist)))

Submission status: Accepted

Solution code:
from sys import stdin


def get_result(data):
    N = data[0][0]
    A = data[1:]
    tmp = set()
    for i in range(int(N)):
        tmp.add(A[i][0])
    return len(tmp)


if __name__ == '__main__':
    raw_data = [val.rstrip() for val in stdin.readlines()]
    data = [list(map(str, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)

Submission status: Accepted

Solution code:
N = int(input())
keihin = {}
for i in range(N):
    gacha = input()
    if gacha in keihin:
        keihin[gacha] += 1
    else:
        keihin[gacha] = 1
print(len(keihin))

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    times = int(stdin.readline())
    results = []
    for x in range(times):
        results.append(stdin.readline())
    
    print(len(set(results)))


main()

Submission status: Accepted

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

for i in range(0, N):
  S.append(input())

S = set(S)

print(len(S))

Submission status: Accepted

Solution code:
import collections

n=int(input())
s=list()

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


res=collections.Counter(s)
print(len(res))

Submission status: Accepted

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

print(len(list(set(l))))

Submission status: Accepted

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

ans = set(ss)
print(len(ans))

Submission status: Accepted

Solution code:
n=int(input())
d={}
for i in range(n):
    s=input()
    d[str(s)]=1

print(len(d))

Submission status: Accepted

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

L = set(S)

print(len(L))

Submission status: Accepted

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

C()

Submission status: Accepted

Solution code:
import collections

N = int(input())

S = ""
Slist = []
strlist = []
for count in range(N):
    S = str(input())
    Slist.append(S)

strlist = collections.Counter(Slist)

print(len(strlist))

Submission status: Accepted

Solution code:
d={}
ct=0
for _ in range(int(input())):
  s=input()
  if s not in d:
    d[s]=1
    ct+=1
print(ct)

Submission status: Accepted

Solution code:
import sys
import collections

n = int(input())
s = sys.stdin.readlines()
ans = collections.Counter(s)
print(len(ans))

Submission status: Accepted

Solution code:
n = int(input())

item = {}

import collections

l = [input() for i in range(n)]
c = collections.Counter(l)

print(len(c.keys()))

Submission status: Accepted

Solution code:
from collections import Counter

if __name__ == '__main__':
    n = int(input())
    cnt = Counter([input() for i in range(n)])
    print(len(cnt.keys()))

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:
def gacha():
    N=int(input())
    string=[]
    for i in range(0,N):
        s=input()
        string.append(s)
    result=list(set(string))
    print(len(result))

if __name__=="__main__":
    gacha()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=eval(input(""))
li=[]
while(num!=0):
  li.append(input())
  num-=1
a=set(li)
print(len(a))

Submission status: Accepted

Solution code:
N = int(input())

dct = {}
for i in range(N):
  s = input()
  if s in dct.keys():
  	dct[s] += 1
  else:
    dct[s] = 1
    
print(len(dct))

Submission status: Accepted

Solution code:
def main():
  N = int(input())
  li = [input() for i in range(N)]
  print(len(list(set(li))))


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input())
l = []
for i in range(n):
    x = input()
    l.append(x)
ans = n
l.sort()
for i in range(1,n):
    if l[i] == l[i-1]:
        ans -= 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N = II()
    S = [input() for i in range(N)]
    Sn = set(S)

    print(len(Sn))


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n = int(input())

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

di = {}
cnt = 0

for nl in s:
    if str(nl) not in di:
        di[str(nl)] = 1
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections
i = int(input())
reward = [input() for t in range(i)]
print(len(collections.Counter(reward)))

Submission status: Accepted

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

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

print(len(set(S)))

Submission status: Accepted

Solution code:
n = int(input())
val = {}
ans = 0

for i in range(n):
    key = input()
    try:
        val[key]
    except Exception:
        val.update({key: 0})
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
n=int(input())
A=[]
for _ in range(n):
    x=input()
    A.append(x)
print(len(set(A)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

num = int(input())
item = [input() for i in range(num)]

item_count = collections.Counter(item)

print(len(item_count.keys()))

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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(list(set([input() for _ in range(n)]))))

Submission status: Accepted

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

    set(s)
    
    return len(set(s))
    
print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lst = [input() for x in range(n)]

print(len(set(lst)))

Submission status: Accepted

Solution code:
import collections

N = int(input())
count = collections.Counter()
for _ in range(N):
    count[input()] += 1

print(len(count.items()))

Submission status: Accepted

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

print(len(set(ls)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S =[]
for i in range(N):
    val = input()
    if val:
        S.append(val)
import collections
c = collections.Counter(S)
n = 0
for i in c.keys():
    n += 1
    
print(n)

Submission status: Accepted

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

c = dict(collections.Counter(s))

print(len(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=int(input())
moji_set=set()
for i in range(num):
    line=input()
    moji_set.add(line)
print(len(moji_set))

Submission status: Accepted

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

print(len(set(s_list)))

Submission status: Accepted

Solution code:
n = int(input())
items = {}
for _ in range(n):
    s = input()
    if s not in items:
        items.setdefault(s,1)
    else:
        items[s] +=1
print(len(items))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

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

ans = set(S)

print(len(ans))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

# C - gacha
N = int(input())
dic = dict()

for i in range(N):
	S = input()
	
	if not S in dic.keys():
		dic[S] = 1

print(len(dic))

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

Solution code:
a = int(input())
aaa = set([])
for i in range(a):
    n = input()
    aaa.add(n)
print(len(aaa))

Submission status: Accepted

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

print(len(set(l)))

Submission status: Accepted

Solution code:
n =int(input())

a = set()

for _ in range(n):
    k = input()
    a.add(k)

print(len(a))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())

S = defaultdict(int)

for i in range(N):
    S[input()] += 1
 
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s = [input() for _ in range(n)]

print(len(set(s)))

Submission status: Accepted

Solution code:
#C
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
# print(s)
s=Counter(s)
print(len(s))

Submission status: Accepted

Solution code:
n=int(input())
l=[]
while n>0:
    s=input()
    l.append(s)
    n -= 1
print(len(set(l)))

Submission status: Accepted

Solution code:
N = int(input())

kuji_dict = {}
for i in range(N):
  name = input()
  kuji_dict[name] = 1
  
print(len(kuji_dict.keys()))

Submission status: Accepted

Solution code:
N=int(input())
s=[input() for i in range(N)]
s=sorted(s)
yobunn=0
for i in range(N-1):
    if s[i]==s[i+1]:
        yobunn=yobunn+1
print(N-yobunn)

Submission status: Accepted

Solution code:
from math import factorial as fact
import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(n,r))

def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def factorization(n):
	tmp=n
	count=0
	for i in range(2,int(n**0.5)+2):
		if tmp%i==0:
			cnt=0
			while tmp%i==0:
				cnt+=1
				tmp//=i
			count+=1
	if tmp!=1:
		count+=1

	return count
			




n=input1()
s=[]
d={}
for k in range(n):
	ch=str(input())
	s.append(ch)
	d[ch]=0
for i in s:
	d[i]+=1
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())

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

print(len(s))

Submission status: Accepted

Solution code:
n = int(input().rstrip())

sa = []
for i in range(n):
    line = input().rstrip()
    sa.append(line)

print(len(set(sa)))

Submission status: Accepted

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

print(len(set(S)))

Submission status: Accepted

Solution code:
n=int(input())
a={}
ans=0
for i in range(n):
  aa=str(input())
  if aa in a:
    b=0
  else:
    a[aa]=i
    ans+=1
    #print(i)
print(ans)
#print(a)

Submission status: Accepted

Solution code:
N = int(input())
S = {}
for i in range(N):
  s = input()
  if s in S:
    S[s] = S[s] + 1
  else:
    S[s] = 1

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

a = set(s)

print(len(a))

Submission status: Accepted

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

# -- submit ----

# --- fetch input ---
inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break

# --- write code below ---

n = int(inputs[0])
goods = inputs[1:]

goods_list = set(goods)
print(len(goods_list))

Submission status: Accepted

Solution code:
import collections
N=int(input())
S=[input() for i in range(N)]
sc=collections.Counter(S)
ans=len(sc)
print(ans)

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    N = int(input())

    S = set()
    for _ in range(N):
        s = input().strip()
        S.add(s)
    print(len(S))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    get_freebie = {}
    for i in range(roop_num):
        freebie = input()

        if not freebie in get_freebie:
            get_freebie[freebie] = 0

    print(len(get_freebie))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

arr = list(set(arr))
ans = len(arr)

print(ans)

Submission status: Accepted

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

print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ss = set({})

for i in range(n):
    ss.add(input())
    
print(len(ss))

Submission status: Accepted

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

Submission status: Accepted

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

  print(len(set(S)))
  
if __name__ == "__main__":
  main()