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:
#C

#デバッグ
debug=1
def pront(*n):
    if debug==1:
        print(n)
        
#10**9+7を底とした処理

base=10**9+7

def add(a,b):#a+b
    return (a+b)%base

def sub(a,b):#a-b
    return (a-b)%base

def multi(a,b):#a*b
    return (a*b)%base

def exp(a,b):#a**b
    x=1
    c=a
    d=b
    while d!=0:
        if d%2==1:
            x=multi(x,c)
        c=(c**2)%base
        d=d//2
    return x

def div(a,b):#a/b
    return(multi(a,exp(b,base-2)))

#入力

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


#処理

X={}
for i in S:
    if i in X:
        pass
    else:
        X[i]=1
print(len(X))

Submission status: Accepted

Solution code:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N = int(input())
    S = [None] * N
    for i in range(N):
        S[i] = input().rstrip()

    c = Counter(S)
    ans = len(c.keys())
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
prize = Counter()
N = int(input())
for i in range(N):
    prize[input()] += 1

print(len(list(prize.keys())))

Submission status: Accepted

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

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:
# This was written by chizuchizu
import sys
# import collections

# import bisect
# import math
import numpy as np

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()

    """この下から書いてね"""
    # n, m = ip.IL()
    # a = np.array(ip.IL())
    # for _ in range(m):
    #     a[np.argmax(a)] //= 2
    # print(np.sum(a))
    n = int(input())
    s = ip.SLS(n)
    print(len(set(s)))


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
ans = 0
for i in range(n):
    s = input()
    if s not in dic:
        dic[s] = 1
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(len(items))

Submission status: Accepted

Solution code:
n = int(input())
#a,b = map(int,input().split())
#s_L = list(map(int,input().split()))

L = []

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

print(len(set(L)))

Submission status: Accepted

Solution code:
def main():

    N = int(input())
    v = set()
    for _ in range(N):
        v.add(input())
    return len(v)

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(len(V))

Submission status: Accepted

Solution code:
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    s = []
    n = ii()
    for i in range(n):
        tmp = input()
        s.append(tmp)
    s = list(set(s))
    print(len(s))


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:
import sys
sys.setrecursionlimit(1000000)

def solve(As):
    return len(set(As))

if __name__ == "__main__":
    N = int(input())
    As = []
    for _ in range(N):
        As.append(input())
    print(solve(As))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

sets = set()
for s in S:
    sets.add(s)

print(len(list(sets)))

Submission status: Accepted

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

N = int(input())
Sss = [input().rstrip() for _ in range(N)]

print(len(set(Sss)))

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

print(len(set(l)))

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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

    ss = set(s)

    print(len(ss))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

# sys.setrecursionlimit(100000)
input = sys.stdin.buffer.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, S):
    return len(set(S))


def main():
    N = read_int()
    S = [read_str() for _ in range(N)]
    print(slv(N, S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():

    from bisect import bisect_left as bl, bisect_right as br, insort
    import sys
    import heapq
    # from math import *
    from collections import defaultdict as dd, deque
    def data(): return sys.stdin.readline().strip()
    def mdata(): return map(int, data().split())
    out = sys.stdout.write
    # sys.setrecursionlimit(100000)

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




if __name__ == '__main__':
    main()

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 = set()
for _ in range(n):
    a.add(input())
print(len(a))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
from collections import Counter

n = int(input())
ss = []

for _ in range(n):
    ss.append(input().rstrip())

cnt = Counter(ss)
print(len(cnt))

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
S = [sr() for _ in range(N)]
se = set(S)
answer = len(se)
print(answer)

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())
s = [input() for _ in range(n)]

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n=II()
    ss=set()
    for _ in range(n):
        s=SI()
        ss.add(s)
    print(len(ss))

main()

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
dd = defaultdict(int)

for i in range(n):
    s=input()
    dd[s]+=1
print(len(dd))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#create date: 2020-04-26 21:03

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    s = set()
    for _ in range(n):
        s.add(ns())
    print(len(s))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

N = Int()
D = {}
ans = 0
for i in range(N):
    s = input()
    if not s in D:
        ans += 1
        D[s] = 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(ans))

Submission status: Accepted

Solution code:
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    n = int(input())
    S = {input() for _ in range(n)}
    print(len(S))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

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

N = int(input())
S = [0]*N
for i in range(N):
    S[i] = input()

print(len(Counter(S)))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
s = defaultdict(int)

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

print(len(s.keys()))

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
a = set()
for _ in range(n):
    a.add(input().rstrip())
print(len(a))

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(s)

ans = len(c)
print(ans)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()
s = nsn(n)

print(len(set(s)))

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(list(set(a))))

Submission status: Accepted

Solution code:
from collections import *

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

print(len(s))

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
import heapq
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = [S() for i in range(N)]
print(len(set(a)))

Submission status: Accepted

Solution code:

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	D = defaultdict(int)
	N = int(input())
	for i in range(N):
		S = input()
		D[S] += 1

	ans = len(D)
	print(ans)
	
if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
def main():
    from collections import Counter
    import sys
    input = sys.stdin.readline

    N = int(input())
    s = [input().rstrip() for _ in range(N)]

    ctr = Counter(s)

    ans = len(ctr.keys())

    print(ans)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
lst = [input() for i in range(N)]
counter = Counter(lst)
print(len(counter))

Submission status: Accepted

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

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:
import sys
readline = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
ct = Counter([input() for _ in range(N)])
print(len(ct))

Submission status: Accepted

Solution code:
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()
good={}
ans = 0 
for i in range(N):
    x = ns()
    if x in good:
        good[x]=good[x]+1
    else:
        good[x] = 1 
        ans = ans + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    print(len(set([input() for _ in [0]*n])))


main()

Submission status: Accepted

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

ans = 0
R = {}

for i in S:
  if i not in R:
    ans += 1
    R[i] = 1

print(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:
N = int(input())
s = set()
for i in range(N):
    c = input()
    s.add(c)
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
A = []
for i in range(N):
    A.append(input())
print(len(set(A)))

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

n = INT()
s = [STR() for _ in range(n)]
print(len(set(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = set()

for i in range(n):
    a.add(ns())

print(len(a))

Submission status: Accepted

Solution code:
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


# Generated by 1.1.6 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
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, S))

if __name__ == '__main__':
    main()

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

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

List2 = list(set(List))

print(len(List2))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

N = ii()
d = defaultdict(int)

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

print(len(d.keys()))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
s = set()
for n in range(N):
    st = input()
    s.add(st)

print(len(s))

Submission status: Accepted

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

an = set()
for i in s:
    an.add(i)

print(len(an))

Submission status: Accepted

Solution code:

N = int(input())

dic = {}

for i in range(N):

    s = input()
    dic[s] = 1

print (len(dic))

Submission status: Accepted

Solution code:
n = int(input())
from collections import Counter

ss = []
for i in range(n):
    s = input()
    ss.append(s)
c = Counter(ss)
print(len(c))

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
l = [input() for _ in range(n)]
print(len(set(l)))

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:
from collections import defaultdict
N=int(input())

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

Submission status: Accepted

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

print(len(A))

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())
S = []
for _ in range(N):
    s = input()
    S.append(s)
print(len(set(S)))

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 i in range(N):
    S.append(str(input()))

S.sort()

ans = 0
before = ""
for i in range(N):
    if S[i] != before:
        ans += 1
        before = S[i]

print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = I()
    d = set()
    for i in range(n):
        s = S()
        d.add(s)
    print(len(list(d)))


main()

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

po = set()

for i in range(n):
    x = input()[:-1]
    po.add(x)
print(len(po))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n = inp()
    dic = defaultdict(int)
    for _ in range(n):
        s = input()
        dic[s] = 1
    ans = 0
    for e in dic:
        ans += dic[e]
    print(ans)    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, S: "List[str]"):
    s = set()
    for i in range(N):
        s.add(S[i])
    print(len(s))
    return


# Generated by 1.1.6 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
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(k) for k in input().split()]
#template

N = int(input())
li = [0]*N
for i in range(N):
    li[i] = input()

print(len(set(li)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def input_int():
    return int(input())

def input_ints():
    return list(map(int, input().split()))

N = input_int()
print(len(set(input() for _ in range(N))))

Submission status: Accepted

Solution code:
from collections import defaultdict
n=int(input())
d=defaultdict(int)
for i in range(n):
    s=input()
    d[s]+=1
print(len(d))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
S = [input() for i in range(n)]
SS = set(S)
print(len(SS))