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: Runtime Error

Solution code:
n = int(input().split())
mylist = list(range(0))
inp = ''
for i in range(n):
    inp = input()
    if (inp not in mylist):
        mylist.append(inp)
print(len(mylist))

Submission status: Runtime Error

Solution code:
N = int(input())

arr = []

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

print(len(arr.set()))

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
flag = 1
l = [[0] * n for i in range(10)]
ind = 0
s = [0] * n

for i in range(n):
    s[i] = input()
    flag = 1
    for j in range(len(l[len(s[i])])):
        if s[i] == l[len(s[i])][j]:
            flag = 0
            break
    if flag:
        l[len(s[i])].append(s[i])
        count += 1

print(count)

Submission status: Runtime Error

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

for i in range(N):
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if S[j][0] == S[i][0]:
                if S[j] == S[i]:
                    S[j] = ''
                    ans = ans - 1
                    flg = 1
        j = j+1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import random

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

# l = list(range(n-1))
ll = []
for j in range(n):
    ll.append(m[random.randrange(n-1)])
print(len(set(ll)))

Submission status: Runtime Error

Solution code:
N = int(input())
l = [input()]
for i in range(1,N):
    s = 0
    t = i
    a = input()
    while t-s > 1:
        if a <= l[int((s+t+1)/2)]:
            t = int((s+t+1)/2)
        else:
            s = int((s+t+1)/2)
    if l[s] != a:
        l.insert(t,a)
print(len(l))

Submission status: Runtime Error

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

a, b, c, d = map(int, input().split(' '))

n = max([int(a / d) + 1, int (c / b) + 1])

for i in range(n):
    a -= d
    c -= b
    # print(a,c)
    if c <= 0:
        print('Yes')
        exit()
    elif a <= 0:
        print('No')
        exit()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
bool check(vector<string> A, string S){
     for(string x : A) {
        if(S == x) return false;
    }
    return true;
}

int main(){
    int N, count = 0;
    string S;  
    cin >> N;
    vector<string> A(N);
    for(int i=0;i<N;i++){
        cin >> S;
        if(check(A,S)){
            A.push_back(S);   
            count++;
        }  
    }
    cout << count << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(len(set(str_list)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
a = []
for i in range(N):
  b = input()
  flag = 0
  for j in range(len(a)):
    if b == a[j]:
      flag = 1
  if flag == 0:
    a.append(b)
    
print(len(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
s=[list(map(str,input().split())) for _ in range(n)]
t=list(set(s))
print(len(t))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))

n = aint()
get = [[],[],[],[],[],[],[],[],[],[]]
for i in range(n):
    s = input()
    if s not in get[len(s)-1]:
        get[len(s)-1].append(s)

ss = 0
for cont in get:
    ss += sum(cont)
print(ss)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    string s;
    set<string> S;
    for (int i = 0; i < N; i ++){
        cin >> s;
        S.insert(s);
    }
    cout << S.size() << endl;
}

Submission status: Runtime Error

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

print(len(S))

Submission status: Runtime Error

Solution code:
N = int(input())

s=[]
flag = 0
for i in range(N):
  s.append(input())
num = 0

while(len(s) != 0):
  for i in range(len(s)):
    if(s[0] == s[i]):
      flag += 1
  for i in range(flag):
    s.remove(s[0])
  num += 1
print(num)

Submission status: Runtime Error

Solution code:
n=iinput())
s=list()
for i in range(n):
 s.append(input())
print(len(set(s)))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
items = []
count = 0
for x in range(N):
  thing = input()
  if thing not x in items:
    count += 1
  	items.append(thing)
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
strings=[]
counter=0
for number i range(0,N):
  S=input()
  if S not in strings:
    strings.append(S)
    counter+=1
print(counter)

Submission status: Runtime Error

Solution code:
	n = int(input())
	s = []
	d = {}
	ans = 0
	for _ in range(n):
		s.append(input())
	for i in s:
		if not d.get(i):
			ans += 1
			d[i] = True
	print(ans)
resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
items = []
count = 0
for x in range(N):
  thing = input()
  if thing is not in items:
    count += 1
  items.append(thing)
print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C, D = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

while(1):
    C = C-B
    if C <= 0:
        print("Yes")
        break
    A = A-D
    if A <= 0:
        print("No")
        break

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
ans = 0
for _ in range(N):
  B = input()
  if not B in A:
    ans += 1
    A.append(input())
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

lis = []

for n in range(N):
  s = input()
  if not s in lis:
    s.append(s)

print(len(lis))

Submission status: Runtime Error

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: Runtime Error

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

print(len(list(set(list1))))

Submission status: Runtime Error

Solution code:
import pandas as pd
n = int(input())
s = [input() for _ in range(n)]
x = set(s)
print(len(x))

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())

e=a//d
f=c//b

if a == d:
    e -= 1
if c == b:
    f -= 1

if e >= f:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
4
aaaa
a
aaa
aa

Submission status: Runtime Error

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 = [[] for i in range(10)]

	ans = 0
	for i in range(N):
		tmp = input()
		tmp = tmp[:-1]
		tmptmp = len(tmp)

		if tmp in S[tmptmp]:
			continue
		else:
			S[tmptmp].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: Runtime Error

Solution code:
from collections import Counter
a=int(input())
list1=[]
for i in range(a)
list1.append(input())
a=set(list1)
print(len(a))

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
n=int(input())

s=input().split()

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

for i in range(0,n):
    print(ans[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

ans = {}
for i in range(N):
    ans.add(input())

print(len(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l = []
c=0
for i in s:
    if i not in l:
        l.append(i)
	c+=1
print(c)

Submission status: Runtime Error

Solution code:
port 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: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=set(a)
print(len(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin

def main():
    n = int(input())
    lst = set([stdin.readline()[:-1] for _ in range(n)])
    print(len(lst)))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
n_list = []
for i in range(N):
    n_list.append(input())
print(len(dict(Counter(n_list))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
L=[]
for i for range(N):
  L.append(str(input()))
A=list(set(L))
print(len(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
#n,k=list(map(int,input().split()))
ans=defaultdict(int)
for i in range(n):
    s=input()
    ans[s]+=1

print(len(ans.keys()))