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

new_l = []

for i in l:
  if not i in new_l:
    new_l.append(i)

print(len(new_l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():

    n = int(input())
    db = []
    kinds = 0

    for i in range(10):
        tmp = []
        db.append(tmp)

    for i in range(n):
        str = input()
        num = len(str)

        if(not(str in db[num-1])):
            db[num-1].append(str)
            kinds = kinds + 1

    print(kinds)

main()

Submission status: Time Limit Exceeded

Solution code:
N = input()
a = []
for i in range(int(N)):
  x = input()
  TF = x in a
  if TF != True:
    a.append(x)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
N = input()
a = []
for i in range(int(N)):
  x = input()
  
  if str(x in a) != "True":
    a.append(x)
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

n = int( input() )

amat = list()
#print( amat )

for i in range( n ):
    ai = input()
    if all( [ aj != ai for aj in amat ] ):
       amat.append( ai )
#       print( amat )

ans = len( amat )
print( ans )

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = []
cnt = 0
append = A.append
for i in range(n):
    m = input()
    if m in A:
        pass
    else:
        append(m)
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

l = []
for _ in range(N):
  s = input()
  if l.count(s) == 0:
    l.append(s)

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

s_list = []
cnt = 0
for i in range(N):
    candidate = input()
    for s in s_list:
        if candidate == s:
            break
    else:
       cnt += 1
       s_list.append(candidate)

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = []
cnt = 0
for i in range(n):
    m = input()
    if m in A:
        pass
    else:
        A.append(m)
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
list = []

n = int(input())

for i in range(n):
    words = str(input())
    if words  in list:
        n -=1
    else:
        list.append(words)

print(n)

Submission status: Time Limit Exceeded

Solution code:
list = []

n = int(input())

for i in range(n):
    words = str(input())
    if list.count(words) == 0:
        list.append(words)
    else:
        n -= 1

print(n)

Submission status: Time Limit Exceeded

Solution code:
# encoding="UTF-8"

N = int(input())
S = []
for i in range(N):
    temp=input()
    if (temp in S) == False:
        S.append(temp)
print(len(S))

Submission status: Time Limit Exceeded

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

count = N
for i in range(N-1):
    for j in range(i+1,N):
        if s[i]==s[j]:
            count=count-1
            break
        

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
Row = int(input())
List = list(input() for i in range(Row))
List.sort()
a=Row-1
while a>0:
 if List[a] == List[a-1]:
  List.remove(List[a])
  a-=1
 else:a-=1
else:print(len(List))

Submission status: Time Limit Exceeded

Solution code:
loopCnt = int(input())

strList = []
for i in range(loopCnt):
    inputStr = input()

    if not inputStr in strList:
        strList.append(inputStr)

print(str(len(strList)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ansl = []
ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
item_list = []
for n in range(N):
    item = str(input())
    if item_list.count(item) == 0:
        item_list.append(item)

print(len(item_list))

Submission status: Time Limit Exceeded

Solution code:
import sys
import math

lines = sys.stdin.readlines()
N = int(lines[0])
X = []

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X = X + [Si]

X.sort()

z = 1
for i in range(N-1):
  if X[i] != X[i+1]:
    z +=1
print(z)

Submission status: Time Limit Exceeded

Solution code:
import sys
import math

lines = sys.stdin.readlines()

N = int(lines[0])
X = set([])

for i in range(N):
  Si = str(lines[i+1].split('\n')[0])
  X = X | set([Si])

print(len(X))

Submission status: Time Limit Exceeded

Solution code:
t = int(input())
ans = []
while t:
  s = input()
  if s not in ans:
    ans.append(s)
  t = t - 1
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
arr = []

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

S = []
for i in range(0,N):
    if i > 0:
        Value = input()
        Flag = False
        for j in range(len(S)):
            if S[j] == Value:
                Flag = True
                break

        if Flag == False:
            S.append (Value)

    else:
        S.append (input())

print(len(S),end='\n')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = n
s = []
for i in range(n):
    temp = input()
    if temp in s:
        ans -= 1
    else:
        s.append(temp)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = n
s = []
for i in range(n):
    temp = input()
    if temp in s:
        ans = ans - 1
    else:
        s.append(temp)
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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 = []
count = 0
for i in range(N):
    item = input()
    if item not in S:
        S.append(item)
        count += 1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for _ in range(N-1):
    a = input()
    imin = 0
    imax = len(L)-1
    l = 0

    while (imin<imax):
        l = (imin+imax)//2
        if (a==L[l]):
            break
        elif (a>L[l]):
            imin = min(l+1,len(L)-1)
        else:
            imax = max(l-1,0)    
    l = (imin+imax)//2       
    if (a>L[l]):
        L.insert(l+1,a)
    elif (a<L[l]):
        L.insert(l,a)
            
print(len(L))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for _ in range(N):
    S.append(input())
#2-3-1. 最初にすべて読み込む必要がある場合 - 行列、グリッド

[x for x in set(S) if S.count(x) > 1]
#重複した要素を抽出し、新たなリストを生成

print(len(set(S)))

Submission status: Time Limit Exceeded

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

for _ in range(N-1):
    a = input()
    imin = 0
    imax = len(L)-1

    while (imin<imax):
        l = (imin+imax)//2
        if (a==L[l]):
            break
        elif (a>L[l]):
            imin = l
        else:
            imax = l
    
    if (a>L[imin]):
        L.insert(imin+1,a)
    elif (a<L[imin]):
        L.insert(imin,a)
            
print(len(L))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
G = []
S = []
r = 0
t = 0
for i in range(N):
    p = input()
    l = len(p)
    if not l in G:
        G.append(l)
        #S[t].append(len(p))
        S.append([p])
        t += 1
    else:
        z = G.index(l)
        if not p in S[z]:
            S[z].append(p)
x = 0
for w in range(len(G)):
    x += len(S[w])
print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
S.append(input())
r = 1
for i in range(N-1):
    p = input()
    q = 0
    for k in range(r):
        if p == S[k]:
            q = 1
            break
    if q == 0:
        S.append(p)
        r += 1
print(r)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
S.append(input())
for i in range(N-1):
    p = input()
    q = 0
    for k in range(len(S)):
        #print(len(S))
        #print(S)
        if p == S[k]:
            q = 1
    if q == 0:
        S.append(p)
print(len(S))
#print(S)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
gachalist = []
for i in range(N):
    item = input()
    if item in gachalist:
        continue
    else:
        gachalist.append(item)
print(len(gachalist))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

list = []
list.append(input())

M = 1
for num in range(N -1):
    S = input()
    P = int(S in list)
    if P == 0:
        list.append(S)
        M = M + 1
print(M)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
order = int(input())
data = []
ans = 0

for i in range(order):
    val = input()
    if val not in data:
        data.append(val)
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input().rstrip())
l = []
for i in range(n):
  j = input().rstrip()
  if j in l:
    l = l
  elif j not in l:
    l = l+[j]
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Y = [[[] for _ in range(26)] for _ in range(10)]
# print(Y)
c = 0

for i in range(N):
    s = input()
    o = ord(s[0])-97
    l = len(s)
    if s not in Y[l-1][o]:
        Y[l-1][o].append(s)
        c += 1
# print(Y)
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Y = [[] for _ in range(26)]
c = 0

for i in range(N):
    s = input()
    o = ord(s[0])-97
    if s not in Y[o]:
        Y[o].append(s)
        c += 1
# print(Y)
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Y = [[] for _ in range(10)]
c = 0
for i in range(N):
    s = input()
    l = len(s)
    if s not in Y[l-1]:
        Y[l-1].append(s)
        c += 1
# print(Y)
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input().rstrip())
l = []
for i in range(n):
  j = input().rstrip()
  if j in l:
    l = l
  else:
    l = l+[j]
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
cnt=1
for i in range(n):
	a.append(input())
for i in range(0,n):
	for j in range(i+1,n):
		if a[i]==a[j]:
			break
		elif j == n-1:
			cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
lis =[]
abc =[]
count = 0

N = int(input())
for _ in range(N):
    lis.append(input()) 

for i in lis:
    if i in abc:
        pass
    else:
        abc.append(i)
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = {}

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = {}
ans = N
S = [input() for i in range(N)]
#for i in range(N):
#    S.append(input())
S.sort()
for i in range(N):
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
#            if len(S[j]) == len(S[i]):
#                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: Time Limit Exceeded

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: Time Limit Exceeded

Solution code:
def binary_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

    return -1

if __name__ == '__main__':
    N = int(input())
    l = []
    for i in range(N):
        word = input()
        index = binary_search(l,word)
        if  index == -1:
            l.append(word)
        l = sorted(l)
    print(len(l))

Submission status: Time Limit Exceeded

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

print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s=[]
s#+=['a']
#s+=['b']
#print(s)
c = 0
ans = 1
for i in range(n):
    s += [input()]
for i in range(1,n):
    for j in range(i):
        if s[i] == s[j]:
            c += 1
    if c == 0:
        ans += 1
    c = 0
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [""] * n
 
for i in range(n):
  s[i]=input()
 
for i in range(n):
  for j in range(i,n-1):
    if s[j] < s[j+1]:
      temp = s[j]
      s[j] = s[j+1]
      s[j+1] = temp
    
ans = 1
for i in range(n-1):
  if s[i]!=s[i+1]:
    ans+=1
 
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [""] * n
 
for i in range(n):
  s[i]=input()
 
for i in range(n):
  for j in range(i,n-1):
    if s[j] < s[j+1]:
      temp = s[j]
      s[j] = s[j+1]
      s[j+1] = temp
    
ans = 1
for i in range(n-1):
  if s[i]!=s[i+1]:
    ans+=1
 
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

cnt = 0
kei = [] 
for _ in range(n):
    tmp = input()
    if not tmp in kei:
        cnt += 1
        kei.append(tmp)

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""

n = int(input())

kList = []
for _ in range(n):
    keihin = input()
    if kList:
        if keihin not in kList:
            kList.append(keihin)
    else:
        kList.append(keihin)

print(len(kList))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

n = int(input())

s_list = []
for i in range(n):
  s_tmp = input()
  if s_tmp not in s_list:
    s_list.append(s_tmp)
    
print(len(s_list))

Submission status: Time Limit Exceeded

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

n = int(input())

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

print(len(s_list))

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
y = 0
x = []
new = []
things = int(input())

for i in range(things):
    p = input()
    x.append(p)
for i in x:
    if i not in new:
        new.append(i)

print(len(new))

Submission status: Time Limit Exceeded

Solution code:
uL = []
oL = []

things = int(input())

for i in range(things):
    p = input()
    uL.append(p)

x = [oL.append(x) for x in uL if x not in oL]

print(len(x))

Submission status: Time Limit Exceeded

Solution code:
uL = []
oL = []
c = 0

things = int(input())
for i in range(things):
    p = input()
    uL.append(p)
    
x = [oL.append(x) for x in uL if x not in oL]

print(len(x))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
u_list = []
uo_list = []
e = int(input())

for i in range(e):
    u = input()
    uo_list.append(u)
    if u not in u_list:
        u_list.append(u)

print(len(u_list))

Submission status: Time Limit Exceeded

Solution code:
u_list = []
uo_list = []
e = int(input())

for i in range(e):
    u = input()
    uo_list.append(u)
    
unique = [u_list.append(x) for x in uo_list if x not in u_list]
print(len(unique))

Submission status: Time Limit Exceeded

Solution code:
found = []
i = int(input())
s = 0
for x in range(0,i):
    new = input()
    if new not in found:
        found.append(new)
        s += 1

print(s)

Submission status: Time Limit Exceeded

Solution code:
list = []

num=int(input())

for h in range(num):
    list.append(input())





keihin=[list[0]]



for i in range(1,num):
    for j in range(len(keihin)):
        if(list[i]==keihin[j]):
            break
        if(j==(len(keihin)-1)):
            keihin.append(list[i])

print(len(keihin))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ct=0
p=0
str_list = [input() for _ in range(N)]
for p in range(N):
	for k in range(p+1):
		if str_list[p]==str_list[k] and p==k:
			ct=ct+1
		elif str_list[p]==str_list[k] and p!=k:
			break


print(ct)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = [input() for _ in [0]*n]
ll = list(l)
for x in l:
    if ll.count(x) != 1:
        ll.remove(x)
print(len(ll))

Submission status: Time Limit Exceeded

Solution code:
import sys
count = int(sys.stdin.readline())
zenbu = []

for x in range(count):
    keihin = sys.stdin.readline()

    if not keihin in zenbu:
        zenbu.append(keihin)
print(len(zenbu))

Submission status: Time Limit Exceeded

Solution code:
import sys
count = int(sys.stdin.readline())
zenbu = []

for x in range(count):
    keihin = sys.stdin.readline()

    if not keihin in zenbu:
        zenbu.append(keihin)
print(len(zenbu))

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
count = 0
flag = 1
l = [[[0] * 1 for i in range(10)] for j in range(26)]
s = [0] * n

alpha2num = lambda c: ord(c) - ord('a') + 1


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

print(count)

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
count = 0
flag = 1
l = [[[0] * 1 for i in range(10)] for j in range(26)]
s = [0] * n

alpha2num = lambda c: ord(c) - ord('a') + 1


for i in range(n):
    s[i] = input()
    leng = len(s[i]) - 1
    
    index = list(s[i])[0]
    ind = alpha2num(index) - 1
    
    flag = 1
    if s[i] not in l[ind][leng]:
        l[ind][leng].append(s[i])
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

S_list = []

for n in range(N):
    S = input()
    if not(S in S_list):
        S_list.append(S)
        
print(len(S_list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
l=[]
n=int(input())
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:
n = int(input())
p = []
k = []
c = 0
for i in range(1,n+1,1):
    s = input()
    p.append(s)
for i in p:
    if i not in k:
        k.append(i)
l = len(k)
print(l)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
counter = 0
s = "TEMP"
list = []

while n > 0:
  s = input()
  list.append(s)
  counter = 0
  for item in list:
    if item == s:
      counter = counter - 1
    counter = counter + 1
  counter += 1
  n = n - 1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
# for n_str in range (0, n):
#     s[n_str] = input()
s = [input() for n_str in range(n)]

diction = []
comp_list = []
# print(diction[0])
flag = 0

diction.append(s[0])

for cnt in range(n):
    dict_len = len(diction)
    for dict_search in range(dict_len):
        if s[cnt] == diction[dict_search]:
            flag = 1
    if flag == 0:
        diction.append(s[cnt])
    else:
        flag = 0



print(len(diction))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = [input() for i in range(n)]
cnt = 0
for i,Si in enumerate(lst):
    tf = Si in lst[0:i]
    if tf == False:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
ans = N
S = [input() for i in range(N)]
#for i in range(N):
#    S.append(input())
S.sort()
for i in range(N):
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
#            if len(S[j]) == len(S[i]):
#                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: Time Limit Exceeded

Solution code:
N = int(input())
S = [input() for i in range(N)]
 
for i in range(N):
  S = [s for s in S if s != S[0]]
  if not S:
    print(i+1)
    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s_list = [(input().split()) for i in range(n)]
 
ans = []
num = n 

while len(s_list) > 0:
  x = s_list.pop()
  ans.append(x)
  if x in s_list:
    s_list = [s for s in s_list if s != x]
      
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
n=input()
n=int(n)
s,l=[],[]
for i in range(n):
  s.append(input())
for i in s:
  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(1, N+1):
        S_i = input()
        S.append(S_i)
cnt = 0
for i in range(0, N):
        flg = 0
        for j in range(i+1, N):
                if( S[i] == S[j]):
                        flg = 1
                        break
        if(flg == 0):
                cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
flag = 0
num_list1 = []
num_list2 = []

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

num_list2.append(num_list1[0]) 

for j in range(0,N):
    for item in num_list2:
        if num_list1[j] == item:
            flag = 1
        else:
            pass
    if flag == 0:
        num_list2.append(num_list1[j])
    else:
        flag = 0

print(len(num_list2))

Submission status: Time Limit Exceeded

Solution code:
i = 0
S = []
T = []
N = int(input())
while i < N:
  S.append(input())
  i = i +1

p = 0

for Q in S:
  if not Q in T:
    T.append(Q)
    p = p +1
print(p)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
targeta = []
targetb = []
targetc = []
targetd = []
targete = []
targetf = []
targetg = []
targeth = []
targeti = []
targetj = []
hit = 0
for j in range(num):
    check = input()
    long = len(check)
    if long == 1:
        if check not in targeta:
            targeta.append(check)
            hit += 1
    elif long == 2:
        if check not in targetb:
            targetb.append(check)
            hit += 1
    elif long == 3:
        if check not in targetc:
            targetc.append(check)
            hit += 1
    elif long == 4:
        if check not in targetd:
            targetd.append(check)
            hit += 1     
    elif long == 5:
        if check not in targete:
            targete.append(check)
            hit += 1
    elif long == 6:
        if check not in targetf:
            targetf.append(check)
            hit += 1
    elif long == 7:
        if check not in targetg:
            targetg.append(check)
            hit += 1
    elif long == 8:
        if check not in targeth:
            targeth.append(check)
            hit += 1
    elif long == 9:
        if check not in targeti:
            targeti.append(check)
            hit += 1
    elif long == 10:
        if check not in targetj:
            targetj.append(check)
            hit += 1
print(hit)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    ori = [input() for i in range(n)]
    data = ['']
    low = 0
    high = 1
    count = 0
    key = 0
    for per in ori:
        while(high - low > 1):
            center = (high + low) // 2
            
            if(data[center] > per):
                high = center
            elif(data[center] == per):
                key = 1
                break
            else:
                low = center
        if(key == 0):
            data.insert((high + low) // 2 + 1,per)
            count += 1
        else:
            key = 0
        high = count + 1
        low = 0
        
    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    ori = [input() for i in range(n)]
    data = ['']
    low = 0
    high = 1
    count = 0
    key = 0
    for per in ori:
        while(high - low > 1):
            center = (high + low) // 2
            
            if(data[center] > per):
                high = center
            elif(data[center] == per):
                key = 1
                break
            else:
                low = center
        if(key == 0):
            data.insert((high + low) // 2 + 1,per)
            count += 1
        else:
            key = 0
        high = len(data)
        low = 0
        
    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
count = int(input())
zenbu = []

for x in range(count):
    keihin = input()

    if not keihin in zenbu:
        zenbu.append(keihin)
print(len(zenbu))