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:
N = int(input())
S = [input() for i in range(N)]

keihin  = []

for i in S:
  if i not in keihin:
    keihin.append(i)
    
print(len(keihin))

Submission status: Time Limit Exceeded

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

for n in range(N):
    f = input()
    if f in S:
        continue
    else:
        S.append(f)
        i += 1
        
print(i)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

Submission status: Time Limit Exceeded

Solution code:
#inport
import sys
import numpy as np

#input
N = int(sys.stdin.readline())
items = np.array([])
for i in range(N):
    a = sys.stdin.readline().split()[0]
    if np.any(items == a):
        b = 0
    else:
        items = np.append(items, a)
        

#shori
##初期化

print(np.size(items))

Submission status: Time Limit Exceeded

Solution code:
#inport
import sys
import numpy as np

#input
N = int(sys.stdin.readline())
items = []
for i in range(N):
    items.append(sys.stdin.readline().split())

#shori
##初期化
collection = []

for i in range(N):
    if np.any(np.array(collection) == items[i]):
        a = 0
    else:
        collection.append(items[i])

print(np.size(collection))

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n = int(input())
items = deque()
item = tuple(input() for _ in range(n))

for i in range(n):
    if item[i] not in items:
        items.append(item[i])

print(len(items))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
items = []
item = tuple(input() for _ in range(n))

for i in range(n):
    if item[i] not in items:
        items.append(item[i])

print(len(items))

Submission status: Time Limit Exceeded

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

for i in range(n):
    item = input()
    if item not in items:
        items.append(item)

print(len(items))

Submission status: Time Limit Exceeded

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

print(len(lst))

Submission status: Time Limit Exceeded

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

print(len(lst))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
list=[]
count = 0

for i in range(n):
	
	str = input()
	if (not str in list):
		count += 1
		list.append(str)

print(count)

Submission status: Time Limit Exceeded

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

for i in range(n):
	
	str = input()
	if (not str in list):
		list.append(str)

print(len(list))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[input() for i in range(N)]
ans = 0
kaburiWords=[]
for i in range(N):
  kaburi = False
  if(A[i] not in kaburiWords):
    for j in range(i):
      if(A[i]==A[j]):
        kaburi = True
        kaburiWords.append(A[i])
        break
  else:
    kaburi = True
  if(not kaburi):
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[input() for i in range(N)]
ans = 0
for i in range(N):
  kaburi = False
  for j in range(i):
    if(A[i]==A[j]):
      kaburi = True
      break
  if(not kaburi):
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

l = []
num = 0
for s in range(n):
    i = input()
    if i not in l:
        l.append(i)
        num += 1

print(num)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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:
# C - gacha
from bisect import *
N = int(input())
ans = []
for _ in range(N):
    S = input()
    i = bisect_left(ans,S)
    if i>=len(ans) or ans[i]!=S:
        insort_left(ans,S)
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
# C - gacha
from bisect import *
N = int(input())
ans = []
for _ in range(N):
    S = input()
    i = bisect_left(ans,S)
    if i>=len(ans) or ans[i]!=S:
        ans.insert(i,S)
print(len(ans))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Item  = []
Count = 0
for T in range(0,N):
    S = input()
    if S not in Item:
        Item.append(S)
        Count = Count+1
print(Count)

Submission status: Time Limit Exceeded

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

print(len(s))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
s = []
tmp = ""
for i in range(N):
	tmp = input()
	if tmp in s:
		pass
	else:
		s.append(tmp)

print(len(s))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
S.append(input())
Triger = 0
temp = ""
for i in range(N-1):
  temp = input()
  for j in S:
    if j == temp:
      Triger += 1
      break
  if Triger == 0:
    S.append(temp)
  else:
    Triger = 0
print(len(S))

Submission status: Time Limit Exceeded

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

for i in range(n):
    x = input()
    if (x in l)==False:
        l.append(x)
    sorted(l)
print(len(l))

Submission status: Time Limit Exceeded

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

for i in range(n):
    x = input()
    if (x in l)==False:
        l.append(x)
print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Sn = []
result = 0
for i in range(N):
    s = input()
    if s in Sn:
        result += 1
    Sn.append(s)
print(N-result)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Sn = []
result = 0
for i in  range (N):
    s = input()
    judge = 0
    for Si in Sn:
        if Si == s:
            judge = 1
    if judge == 0:
        result += 1
    Sn.append(s)
print(result)

Submission status: Time Limit Exceeded

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

for i in range(N):
    item = input()
    if item not in items:
        items.append(item)

print(len(items))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

vary = []

for i in range(n):
    char = input()
    if char not in vary:
        vary.append(char)

print(len(vary))

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n = int(input())
c = deque()
for i in range(n):
  C = input()
  if c.count(C) == 0:
    c.append(C)
print(len(c))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list()
for i in range(n):
    k=input()
    q=k in l
    if q==False:
        l.append(k)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
var = 0
res = []
for i in range(n):
    s = input()
    if s in res:
        continue
    res.append(s)
    var += 1

print(var)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
prize = []
for i in range(N):
    s = str(input())
    if s in prize:
        continue
    else:
        prize.append(s)

print(len(prize))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = [""]*n
c = 0
for i in range(n):
  s = input()
  if not s in l:
    c += 1
  l[i] = s
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

gifts = []

for i in range(N):
  gift = input()
  if gift in gifts:
    pass
  else:
    gifts.append(gift)
    
print(len(gifts))

Submission status: Time Limit Exceeded

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

for i in range(N):
    Gift = input()
    Word_list.append(Gift)
    Word_list.sort()

Before_Word = ""

for i in range(N):
    if Word_list[i] != Before_Word:
        ans += 1
        Before_Word = Word_list[i]

print(ans)

# 
# for i in range(N):
#     Gift = input()
#     CHECK = "Nothing"
#     for i in Word_list:
#         if i == Gift:
#             CHECK = "Exist"
#             break
#     if CHECK == "Nothing":
#         Word_list.append(Gift)
#         ans += 1
# # print(Word_list)
# print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Word_list = []
ans = 0
for i in range(N):
    Gift = input()
    CHECK = "Nothing"
    for i in Word_list:
        if i == Gift:
            CHECK = "Exist"
            break
    if CHECK == "Nothing":
        Word_list.append(Gift)
        ans += 1
# print(Word_list)
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

l = []

for _ in range(n):
    s = str(input())
    if not s in l:
        l.append(s)

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

S=[]
char_num=[[] for i in range(10)]

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

for i in S:
    index=len(i)-1
    if not i in char_num[index]:
        char_num[index].append(i)

words=0
for i in range(len(char_num)):
    for j in char_num[i]:
        words+=1

print(words)

Submission status: Time Limit Exceeded

Solution code:
if __name__ == "__main__":
	n = int(input().strip())
	s = []
	for i in range(n):
		s.append(input().strip())
	final = []
	for i in s:
		if i not in final:
			final.append(i)
	print(len(final))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

gacha = []

for i in range(n):
    item = input()
    check = 0
    for j in gacha:
        if(j == item):
            check = 1
            break
    if(check == 0):
        gacha.append(item)

print(str(len(gacha)))

Submission status: Time Limit Exceeded

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

print(len(S))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

keihin = []

for i in range(N):
  S = input()
  if S in keihin:
    continue
  keihin.append(S)

print(len(keihin))

Submission status: Time Limit Exceeded

Solution code:
import sys


def main():
    readline = sys.stdin.readline
    N = int(readline())
    li = []
    for _ in range(N):
        S = readline()
        if S not in li:
            li.append(S)
    print(len(li))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
r = ['0']
for i in range(n):
    k = 0
    tmp = input()
    for j in range(len(r)):
        if(tmp == r[j]):
            k += 1
            break;
    
    if(k == 0):
        r.append(tmp)
        

print(len(r)-1)

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
r = ['0']
for i in range(n):
    k = 0
    tmp = input()
    for j in range(len(r)):
        if(tmp == r[j]):
            k += 1
    
    if(k == 0):
        r.append(tmp)
        

print(len(r)-1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

    if S not in kind:
        kind.append(S)

print(len(kind))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 0
s = list()
while i<n:
    s.append(str(input()))
    i+=1
i = 0
while i < n:
    j = n-1
    while j > 0:
        if s[j] >s[j-1]:
            x = s[j]
            s[j] = s[j-1]
            s[j-1] = x
        j-=1
    i+=1
i = 0
c = 0
x = "0"
while i<n:
    if s[i]!=x:
        x = s[i]
        c+=1
    i+=1

print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [input() for _ in range(N)]
#S = []
ans = 0
for i in range(N):
    dup = False
    if S[i] not in S[:i]:
       ans += 1 
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
#S = [input() for _ in range(N)]
S = []
for i in range(N):
    s = input()
    dup = False
    if s not in S:
        S.append(s)
print(len(S))

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(N):
    ans += 1
    s = S[i]
    for j in range(i):
        if s == S[j]:
            ans -= 1
            break
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
from collections import deque
import copy
def main():
    N = int(input())
    S = []
    for i in range(N):
        s = input()
        if i == 0:
            S.append(s)
            continue
        flag = False
        for j in range(len(S)):
            flag = False
            if len(s) != len(S[j]):
                flag = True
            else:
                for k in range(len(s)):
                    if s[k] != S[j][k]:
                        flag = True
                        break
            if not flag:
                break
        if flag:
            S.append(s)
    print(len(S))
    

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys
from collections import deque
import copy
def main():
    N = int(input())
    S = []
    for i in range(N):
        s = input()
        if i == 0:
            S.append(s)
            continue
        flag = False
        for j in range(len(S)):
            if s == S[j]:
                flag = True
        if not flag:
            S.append(s)
    print(len(S))
    

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

L = []
for i in l:
  if i not in L:
    L.append(i)
 
print(len(L))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
def main():
    type_num_of_item = int(input())
    
    item_name_list = []
    
    for item_number in range(type_num_of_item):
        item_name = input()
        if not item_name in item_name_list:
            item_name_list.append(item_name)
    
    print(len(item_name_list))

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    if p not in M:
        M.append(p)
        n += 1

print(n)

Submission status: Time Limit Exceeded

Solution code:
N = int(input(""))
M = []

for i in range(N):
    p = input("")
    if p not in M:
        M.append(p)

print(len(M))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def search(list, item):
  low = 0
  high = len(list) - 1
  while(low <= high):
    mid = (low + high) // 2
    guess = list[mid]
    if(guess == item):
      return mid
    if(guess > item):
      high = mid - 1
    else:
      low = mid + 1
  list.insert(low, item)
  return None

n = int(input())
item = []
for i in range(n):
  s = input()
  search(item, s)
print(len(item))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

list = []

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

print(len(list))

Submission status: Time Limit Exceeded

Solution code:
N = input()
l = list()
for i in range(0, int(N)):
  n = input()
  if n in l:
    continue
  else:
    l.append(n)
    
print(len(l))

Submission status: Time Limit Exceeded

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

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())
S = []
for i in range(N):
    temp = input()
    if(temp not in S):
        S.append(temp)

print(len(S))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [0]
flag = 0
for i in range(N):
    if i==0:
        S[i] = input()
    else:
        temp = input()
        for j in range(len(S)):
            if S[j]==temp:
                flag = 1
        if flag==0:
            S = S + [temp]
        flag = 0

print(len(S))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import itertools

N = int(input())
List_S = [""]
for i in range(N):
  S = input()
  if S not in List_S:
    List_S.append(S)
    
print(len(List_S)-1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list=[""]*n
number=0
already=[]
bad=0
for i in range(n):
  list[i]=input()
  for j in range(len(already)):
    if list[i]==already[j]:
      bad=1
      break
  if bad==0:
    number+=1
    already.append(list[i])
  bad=0
print(number)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list=[""]*n
number=0
already=[]
bad=0
for i in range(n):
  list[i]=str(input())
for i in range(n):
  for j in range(len(already)):
    if list[i]==already[j]:
      bad=1
      break
  if bad==0:
    number+=1
    already.append(list[i])
  bad=0
print(number)

Submission status: Time Limit Exceeded

Solution code:
def main():
    input1 = input()
    N = int(input1)
    S = []
    result = 0
    for i in range(N):
        input2 = input()
        if not (str(input2)) in S:
            result += 1
            S.append(str(input2))
    
    print(result)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

N = int(input())

hash = [[0], [0], [0], [0], [0], [0], [0], [0], [0], [0]]

count=0
b=0
for i in range(N):
    b=0
    S = input()
    for j in range(len(hash[len(S)-1])):
        #print("{} {}".format(j,hash[len(S)-1][j]))
        if  hash[len(S)-1][j] == S:
            b=1
    if b==0:
        hash[len(S)-1].append(S)
        count=count+1

#print("{}".format(hash))
print("{}".format(count))

Submission status: Time Limit Exceeded

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

N = int(input())

hash = [[0], [0], [0], [0], [0], [0], [0], [0], [0], [0]]

b=0
for i in range(N):
    b=0
    S = input()
    for j in range(len(hash[len(S)-1])):
        #print("{} {}".format(j,hash[len(S)-1][j]))
        if  hash[len(S)-1][j] == S:
            b=1
    if b==0:
        hash[len(S)-1].append(S)
L=-10;
for i in range(10):
    L =L+len(hash[i])

#print("{}".format(hash))
print("{}".format(L))

Submission status: Time Limit Exceeded

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

print(len(d))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

res = [[] for i in range(26)]

for i in range(N) :
  s = input()
  s_later = s[1:]
  first = ord(s[0]) - ord('a')
  ##res_temp = res
  if(s in res[first]) :
    continue
  else :
    res[first].append(s)
    
    
ans = 0
for i in range(26) :
  ans += len(res[i])

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

res = []
for i in range(N) :
  s = input()
  if(s in res) :
    continue
  else :
    res.append(s)
    
    
print(len(res))

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
n = int(input())
s = list(input() for i in range(n))
s = np.array(s)
i = 0
while 0 < (len(s)):
    s = s[s != s[0]] 
    i += 1
print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

answer = []

for i in range(N):
    if(S[i] not in answer):
        answer.append(S[i])
        
        
print(len(answer))

Submission status: Time Limit Exceeded

Solution code:
Row = int(input())
List = [input() for i in range(Row)]
for i in List:
  while List.count(i)!=1:
    List.remove(i)
print(len(List))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

clip = []
for i in range(N):
    S = input()
    if S not in clip:
        
        clip.append(S)
        
    
print(len(clip))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
clip = []
for i in range(N):
    S = input()
    if S in clip:
        pass
    else:
        clip.append(S)
        count = count + 1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
box = []
S = input()
box.append(S)
count = N
for i in range(N-1):
    S = input()
    for j in range(len(box)):
        if S == box[j]:
            count = count - 1
            break
        box.append(S)
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    if not mozi in lis:
        lis[i] = mozi
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = []
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    if not mozi in lis:
        lis[i] = mozi
        count += 1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
row = int(input())
item_list = [input() for i in range(row)]
result_list = []
for j in item_list:
  if j not in result_list:
    result_list.append(j)

print(len(result_list))

Submission status: Time Limit Exceeded

Solution code:
row = int(input())
item_list = [input() for i in range(row)]
result_list = []
for j in item_list:
  exist_in_item_list = False
  for k in result_list:
    if j == k:
      exist_in_item_list = True
      break
  if not exist_in_item_list:
    result_list.append(j)

print(len(result_list))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = []
cnt = 0

for i in range(n):
    q = input()
    if not q in a:
        a.append(q)
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(len(lis))

Submission status: Time Limit Exceeded

Solution code:
count = int(input())

list = []

for i in range(count):
  str = input()
  if not(str in list):
    list.append(str)

print(len(list))

Submission status: Time Limit Exceeded

Solution code:
num = int(input())

if num>=1 and num<=200000:
  str_list = []
  kind = 0
  for idx in range(num):
    input_str = input()
    if len(input_str)>10:
      continue
    if input_str not in str_list:
      str_list.append(input_str)
      kind += 1
    else:
      pass
  print(kind)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
 
s_list = {}
cnt = 0
for i in range(N):
    candidate = input()
 
    # Check key
    if (candidate[0] in s_list) == False:
        tmp = {candidate[0]:[]}
        s_list.update(tmp)
 
    for s in s_list[candidate[0]]:
        if candidate == s:
            break
    else:
        cnt += 1
        s_list[candidate[0]].append(candidate)
 
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
A=int(input())
list = []
for n in range(A):
	con = str(input())
	if con not in list:
		list.append(con)
	else: pass
print(str(len(list)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

list_get = []
for i in range(len(list_S)):
  if not list_S[i] in list_get:
    list_get.append(list_S[i])

print(len(list_get))

Submission status: Time Limit Exceeded

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

for i in range(n):
  word=input()
  if word not in a:
    a.append(word)
print(len(a))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
num = 0
list1 = []
for i in range(N):
    taisho = input()
    if not taisho in list1:
        num += 1
        list1.append(taisho)
print(num)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
num = 0
list1 = []
for i in range(N):
    list1.append(input())
    flg = 0
    for j in range(i):
        if list1[i]==list1[j]:
            flg = 1
    if flg == 0:
        num += 1
print(num)

Submission status: Time Limit Exceeded

Solution code:
count = int(input())

strlist = []
for i in range(count):
  strlist.append(input())

for i in range(count - 1):
  for j in range(i + 1, count):
    if strlist[i] > strlist[j]:
      tmp = strlist[i]
      strlist[i] = strlist[j]
      strlist[j] = tmp

duplication = 0
for i in range(count - 1):
  if strlist[i] == strlist[i + 1]:
    duplication += 1
    
print(count - duplication)