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

def main():
    N = int(input())
    memo = []
    count = 0
    for s in sys.stdin.readlines():
        if s.rstrip() in memo:
            count += 1
        else:
            memo.append(s.rstrip())
        
    print(N - count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import os

N = input()
S = []
N = int(N)
count = 0
for i in range(int(N)):
    tmp = input()
    if (tmp in S) == False:
        count += 1
        S.append(tmp)

print (len(S))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
s_list = []
S_list = []
for i in range(N):
  s = str(input())
  if len(s)<=5:
    if not (s in s_list):
      s_list.append(s)
  else:
    if not (s in S_list):
      S_list.append(s)
print(len(s_list)+len(S_list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

def c():
    n = int(input())
    s = ['']*n
    for i in range(n):
        temp = input()
        if temp not in s:
            s[i]  = temp
    print(n - s.count(''))

def b():
    a,b,c,d = map(int, input().split())
    while True:
        c -= b
        if c <= 0:
            print('Yes')
            break
        a -= d
        if a <= 0:
            print('No')
            break

def a():
    s, w = map(int, input().split())
    if w >= s:
        print('unsafe')
    else:
        print('safe')



c()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def judge(item,tmp):
  for i in tmp:
    if i == item:
      return False
  return True

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


tmp = []
for i in s:
  if judge(i,tmp):
  	tmp.append(i)
    
print(len(tmp))

Submission status: Time Limit Exceeded

Solution code:
inp_num=int(input())
goods=[]
cont=[]
for i in range(inp_num):
    goods.append(input())
    if goods[i] not in cont:
        cont.append(goods[i])

print(len(cont))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())
    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=[]
l=[]
for i in range(N):
  s.append(input())
  if len(l)==0:
    l.append(s[i])
  if len(l)>0:
    for j in range(len(l)):
      #print(s[i])
      if s[i]==l[j]:
        break
      if j==len(l)-1:
        l.append(s[i])
  
#print(l)
print(len(l))

Submission status: Time Limit Exceeded

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

for i in range(0,N):
  if S[i] != '0':
    count += 1
    for j in range(i+1,N):
      if (S[j] != '0'):
        if S[i] == S[j]:
          S[j] = '0'
         
print (count)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
S = []
A = []
for i in range(N):
    s = input()
    S.append(s)    

n = len(S)
for i in range(n):
    cnt = 0
    for j in range(n):
        if S[i] == S[j]:
            cnt += 1
            if cnt == 2:
                S[j] = 0
print(len([i for i in S if i != 0]))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a_list = []
b_list = []
c_list = []
d_list = []
e_list = []
f_list = []
g_list = []
h_list = []
i_list = []
j_list = []
k_list = []
l_list = []
m_list = []
n_list = []
o_list = []
p_list = []
q_list = []
r_list = []
s_list = []
t_list = []
u_list = []
v_list = []
w_list = []
x_list = []
y_list = []
z_list = []
for i in range(N):
  s = input()
  if s[0] == "a":
    if not s in a_list:
      a_list.append(s)
  if s[0] == "b":
    if not s in b_list:
      b_list.append(s)
  if s[0] == "c":
    if not s in c_list:
      c_list.append(s)
  if s[0] == "d":
    if not s in d_list:
      d_list.append(s)
  if s[0] == "e":
    if not s in e_list:
      e_list.append(s)
  if s[0] == "f":
    if not s in f_list:
      f_list.append(s)
  if s[0] == "g":
    if not s in g_list:
      g_list.append(s)
  if s[0] == "h":
    if not s in h_list:
      h_list.append(s)
  if s[0] == "i":
    if not s in i_list:
      i_list.append(s)
  if s[0] == "j":
    if not s in j_list:
      j_list.append(s)
  if s[0] == "k":
    if not s in k_list:
      k_list.append(s)
  if s[0] == "l":
    if not s in l_list:
      l_list.append(s)
  if s[0] == "m":
    if not s in m_list:
      m_list.append(s)
  if s[0] == "n":
    if not s in n_list:
      n_list.append(s)
  if s[0] == "o":
    if not s in o_list:
      o_list.append(s)
  if s[0] == "p":
    if not s in p_list:
      p_list.append(s)
  if s[0] == "q":
    if not s in q_list:
      q_list.append(s)
  if s[0] == "r":
    if not s in r_list:
      r_list.append(s)
  if s[0] == "s":
    if not s in s_list:
      s_list.append(s)
  if s[0] == "t":
    if not s in t_list:
      t_list.append(s)
  if s[0] == "u":
    if not s in u_list:
      u_list.append(s)
  if s[0] == "v":
    if not s in v_list:
      v_list.append(s)
  if s[0] == "w":
    if not s in w_list:
      w_list.append(s)
  if s[0] == "x":
    if not s in x_list:
      x_list.append(s)
  if s[0] == "y":
    if not s in y_list:
      y_list.append(s)
  if s[0] == "z":
    if not s in z_list:
      z_list.append(s)
count = len(a_list)
count = count + len(b_list)
count = count + len(c_list)
count = count + len(d_list)
count = count + len(e_list)
count = count + len(f_list)
count = count + len(g_list)
count = count + len(h_list)
count = count + len(i_list)
count = count + len(j_list)
count = count + len(k_list)
count = count + len(l_list)
count = count + len(m_list)
count = count + len(n_list)
count = count + len(o_list)
count = count + len(p_list)
count = count + len(q_list)
count = count + len(r_list)
count = count + len(s_list)
count = count + len(t_list)
count = count + len(u_list)
count = count + len(v_list)
count = count + len(w_list)
count = count + len(x_list)
count = count + len(y_list)
count = count + len(z_list)
print(count)

Submission status: Time Limit Exceeded

Solution code:
#200426C
N = int(input())

X = []
ans = 0
for i in range(N):
    S = str(input())
    X.append(S)
for i in range(N):
    if len(X)==0:
        break
    else:
        for j in range(X.count(X[0])):
            X.remove(X[0])
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

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

print(len(ans))

Submission status: Time Limit Exceeded

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

def main():
    N = int(input())
    S = [s.rstrip() for s in sys.stdin.readlines()]
    memo = []
    count = 0
    for s in S:
        if s in memo:
            count += 1
        else:
            memo.append(s)
        
    print(N - count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

    sw = 0
    if i == 0:
        dic.append(s[0])
    else:
        for name in dic:
            if str(name) == str(s[i]):
                sw = 1
                break
        if sw == 0:
            dic.append(s[i])
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(sys.stdin.readline())
list = []
for i in range(N):
  S = sys.stdin.readline()
  if S not in list:
    list.append(S)
print(len(list))

Submission status: Time Limit Exceeded

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

print(c)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

num = int(input())

reward = []

for i in range(num):
    kari = input()
    aru = 0
    for j in range(len(reward)):
        if reward[j] == kari:
            aru = 1
            break
    if aru == 0:
        reward.append(kari)

print(len(reward))

Submission status: Time Limit Exceeded

Solution code:
def check():
    n = int(input())  # 输入n
    list1 = []  # 空列表
    # 进行第一次输入
    for i in range(0, n):  # 从1开始到n-1
        inputStr = input()
        list1.append(inputStr)
    for i in range(0, n - 1):
        for j in range(i + 1, n):
            if list1[i] == list1[j]:
                list1[i] = '0'
    count = 0
    for i in range(0, n):
        if list1[i] != '0':
            count += 1

    print(count)

check()

Submission status: Time Limit Exceeded

Solution code:

def c():
    n = int(input())
    s = []
    for i in range(n):
        temp = input()
        if temp not in s:
            s.append(temp)
    print(len(s))

def b():
    a,b,c,d = map(int, input().split())
    while True:
        c -= b
        if c <= 0:
            print('Yes')
            break
        a -= d
        if a <= 0:
            print('No')
            break

def a():
    s, w = map(int, input().split())
    if w >= s:
        print('unsafe')
    else:
        print('safe')



c()

Submission status: Time Limit Exceeded

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

for i in range(N):
  for j in range(N):
    if S[i] == S[j]:
      count += 1
      
if count == N**2:
  output = 1
else:
  count -= N
  count //= 2
  output = N - count
  
print(output)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
d={}
l=0
for i in range(n):
    s=input()
    if s not in d.values():
        d[l+1]=s
        l+=1

print(len(d))

Submission status: Time Limit Exceeded

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


x = ni()
s=[[],[],[],[],[],[],[],[],[],[]]
sum=0
for i in range(x):
    si=ns()
    sn=len(si)-1
    if si not in s[sn]:
        s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
n = 0
eq = True

for i in range(N):
    s = input()
    n += 1
    for i in range(len(S)):
        if s == S[i]:
            eq = False
    if not eq:
        n -= 1
    S.append(s)
print(n)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=['']*N
s=['']*N
count=0

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

print(count)

Submission status: Time Limit Exceeded

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

c = [x for x in set(List) if List.count(x) > 1]
d = [x for x in set(List) if List.count(x) < 2]

print(len(c)+len(d))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Ss = []
while N > 0:
    s = input()
    if s not in Ss:
        Ss.append(s)
    N = N -1

print(len(Ss))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

B = 0

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

print(B)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if len(S[j]) > 0:
                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:
def main():
    n = int(input())
    data = [[] for i in range(10)]
    key = 0
    count = 0
    for i in range(n):
        prod = input()
        length = len(prod)
        if(length == 0):
            data[length].append(prod)
            count += 1
        else:
            d = data[len(prod) - 1]
            for per in d:
                if(per == prod):
                    key = 1
                    break
            if(key == 0):
                d.append(prod)
                count += 1 
            else:
                key = 0

    print(count)




if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
item_list = []
x = 0
for i in range(n):
  item = input()
  if item in item_list:
    x += 1
  else:
    item_list.append(item)
print(n-x)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s = [0]*n
for i in range(n):
    s[i] = input()
dic = []
count = 1
for i in range(n):
    sw = 0
    if i == 0:
        dic.append(s[0])
    else:
        for name in dic:
            if str(name) == str(s[i]):
                sw = 1
                break
        if sw == 0:
            dic.append(s[i])
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import collections

N = int(input())
keihin=[]
count = 0
for i in range(N):
    p_c = 0
    present = input()
    if len(keihin) == 0:
        keihin = np.append(keihin, present)
        count = count + 1
    else:
        for j in keihin:
            if j == present:
                break
            if j != present:
                p_c = p_c + 1
            if p_c == len(keihin):
                keihin = np.append(keihin, present)
                count = count + 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a,b,c,d,e,v,w,x,y,z = [],[],[],[],[],[],[],[],[],[]
for i in range(0,n):
    s = str(input())
    t = len(s)
    if t == 1:
        m = 0
        for j in range(0,len(a)):
            if s == a[j]:
                m = 1
                break
        if m == 0:
            a.append(s)
    elif t == 2:
        m = 0
        for j in range(0,len(b)):
            if s == b[j]:
                m = 1
                break
        if m == 0:
            b.append(s)
    elif t == 3:
        m = 0
        for j in range(0,len(c)):
            if s == c[j]:
                m = 1
                break
        if m == 0:
            c.append(s)
    elif t == 4:
        m = 0
        for j in range(0,len(d)):
            if s == d[j]:
                m = 1
                break
        if m == 0:
            d.append(s)
    elif t == 5:
        m = 0
        for j in range(0,len(e)):
            if s == e[j]:
                m = 1
                break
        if m == 0:
            e.append(s)
    elif t == 6:
        m = 0
        for j in range(0,len(v)):
            if s == v[j]:
                m = 1
                break
        if m == 0:
            v.append(s)
    elif t == 7:
        m = 0
        for j in range(0,len(w)):
            if s == w[j]:
                m = 1
                break
        if m == 0:
            w.append(s)
    elif t == 8:
        m = 0
        for j in range(0,len(x)):
            if s == x[j]:
                m = 1
                break
        if m == 0:
            x.append(s)
    elif t == 9:
        m = 0
        for j in range(0,len(y)):
            if s == y[j]:
                m = 1
                break
        if m == 0:
            y.append(s)
    else:
        m = 0
        for j in range(0,len(z)):
            if s == z[j]:
                m = 1
                break
        if m == 0:
            z.append(s)
ans = len(a)+len(b)+len(c)+len(d)+len(e)+len(v)+len(w)+len(x)+len(y)+len(z)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = [input() for i in range(N)]
#かぶった回数
cnt = 0
already = [""]
for i in range(N):
    for j in range(len(already)):
        if(S[i] == already[j]):
            cnt += 1
            break
        else:
            already.append(S[i])
print(N - cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

get=[]
      

for i in range(len(List)):
  if get.count(List[i])==0:
    get.append(List[i])

print(len(get))

Submission status: Time Limit Exceeded

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

kind=[]
for e in S:
    if e not in kind:
        kind.append(e)

print(len(kind))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
for i in range(N):
    x = input()
    if len(l) == 0:
        l.append(x)
    else:
        good = True
        for j in range(len(l)):
            if x == l[j]:
                good = False
                break
        if good:
            l.append(x)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
    b=input()
    d=a.count(b)
    if d==0:
        a.append(b)
    else:
        e=1
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
import sys

n = int(input())

list1 = []

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

ans = len(list1)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
listA=[input() for i in range(N)]
listB=[]
[x for x in listA if not x in listB and listB.append(x)]
print(len(listB))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
tmp = input()

WL = []
WL.append(tmp)
leng = 1

for i in range(N-1):
    flg = 1
    tmp = input()
    for j in range(leng):
        if tmp == WL[j]:
            flg = 0
            break
    if flg == 1:
        WL.append(tmp)
        leng += 1

print(leng)

Submission status: Time Limit Exceeded

Solution code:
num=int(input())
lst=[]
counter =0
for i in range(num):
    s=input()
    if s not in lst:
        lst.append(s)
        counter+=1
print(counter)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
N = int(input())
D = deque()
cnt = 0
for _ 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())
S = []
for i in range(N):
  new = input()
  if not(new in S):
  	S.append(new)
print(len(S))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
result = []
for _ in range(n) :
    thing = input()
    if not thing in result :
        result += [thing]
print(len(result))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = [input() for i in range(n)]
o = 0
while n>0:
    ps = s[0]
    n -= s.count(ps)
    o += 1
    for i in range(s.count(ps)):
        s.remove(ps)
print(o)

Submission status: Time Limit Exceeded

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()
    leng = len(s[i])
    flag = 1
    for j in range(len(l[leng-1])):
        if s[i] == l[leng-1][j]:
            flag = 0
            break
    if flag:
        l[leng-1].append(s[i])
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import os

def main():
	n = int(input())
	syo_list = []
	count = 0
	for i in range(n):
		syo = input()
		if not syo in syo_list:
			syo_list.append(syo)
			count += 1
	print(count)

if __name__  == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s = [0]*n
for i in range(n):
    s[i] = input()
dic = []
count = 1
for i in range(n):
    sw = 0
    if i == 0:
        dic.append(s[0])
    else:
        for name in dic:
            if str(name) == str(s[i]):
                sw = 1
        if sw == 0:
            dic.append(s[i])
            count += 1
print(count)

Submission status: Time Limit Exceeded

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

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

for x in list:
    if x in count:None
    else:count.append(x)

print(len(count))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
inp_num=int(input())
goods=[]
cont=[]
for i in range(inp_num):
    goods.append(input())
    if goods[i] not in cont:
        cont.append(goods[i])

print(len(cont))

Submission status: Time Limit Exceeded

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

n = int(input())
l = []
l_append = l.append

for _ in range(n):
  s = input()
  if s not in l:
    l_append(s)
print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[]
for i in range(n):
  a.append(input())
for i in range(n):
  for j in range(n-i-1):
    if a[n-i-1]==a[j]:
      del a[n-i-1]
      break
print(len(a))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
kaisuu = int(input())
getprizelist = []
for i in range(kaisuu):
    keihin = input()
    if keihin not in getprizelist:
        getprizelist.append(keihin)
print(len(getprizelist))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

SL = []

for ss in range(N):
    S = input()
    if not S in SL :
        SL.append(S)


print(len(SL))

Submission status: Time Limit Exceeded

Solution code:
import sys
import collections
import math

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


x = ni()
s=[]
for i in range(x):
    si=ns()
    if si not in s:
        s.append(si)
print(len(s))

Submission status: Time Limit Exceeded

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

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.append(input_line)
    
print(len(gacha_list))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

count = []

for _ in range(N):
    temp = input()
    if temp in count:
        pass
    else:
        count.append(temp)
        
print(len(count))

Submission status: Time Limit Exceeded

Solution code:
get_num=int(input())
get_list=[]
count=0

for i in range(get_num):
    tmp=input()
    if (tmp in get_list)==False:
        get_list.append(tmp)
        count+=1;
    
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

print(len(s))

Submission status: Time Limit Exceeded

Solution code:
import sys


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

    kuji = []

    for s in S:

        if s not in kuji:
            kuji.append(s)

    print(len(kuji))

    return


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

Solution code:

num = int(input())
list = [str(input()) for i in range(num)]
count = 0
l = []

list.sort()

for x in range(num):
    if list[x] in l:
        None
    else:
        l.append(list[x])

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
lis=[]
ans=0
for i in range(N):
	x=input()
	try:
		y=lis.index(x)
	except:
		lis+=[x]
		ans+=1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = []
c = 0
for i in range(N):
    x = input()
    if c == 0:
        l.append(x)
        c += 1
    else:
        good = True
        for j in range(c):
            if x == l[j]:
                good = False
        if good:
            l.append(x)
            c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
K=[]
z=0
for x in range(N):
    k=input()
    K.append(k)
for y in range(N):
    m=max(K)
    K.remove(m)
    if m in K:
        pass
    else:
        z+=1
print(z)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=[]
num=0
for i in range(n):
    x=input()
    if x not in li:
        li.append(x)
        num+=1
print(num)

Submission status: Time Limit Exceeded

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

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

print(n - s.count(0))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
s=["" for i in range(n)]
for i in range(n):
    s[i]=input()
ans=[]
for sj in s:
    tf = True
    for i in ans:
        if i==sj:
            tf = False
            break
    if tf == True:
        ans.append(sj)
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
import itertools

def main():
    N = int(input())
    S = [input() for _ in range(N)]
    memo = []
    count = 0
    for s in S:
        if s in memo:
            count += 1
        else:
            memo.append(s)
        
    print(N - count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
get_num=int(input())
get_list=[]

for i in range(get_num):
    tmp=input()
    if (tmp in get_list)==False:
        get_list.append(tmp)
    
print(len(get_list))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = list()
for i in range(N):
    a = input()
    if a in l:
        a ==0
    else:
        l.append(a)

print(len(l))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
sequence = [input()]
if n!=1:
    for i in range(n-1):
        a = input()
        for sen in sequence:
            if a == sen:
                break
            else:
                if sen == sequence[-1]:
                    sequence.append(a)
print(len(sequence))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
lis=[]
ans=0
for i in range(N):
	x=input()
	try:
		y=lis.index(x)
	except:
		lis+=[x]
		ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
h = list(input() for x in range(N))
a = []
c = 0
for i in range(0, N):
    if h[i] in a:
        c += 1
    else:
        a.append(h[i])
print(N - c)

Submission status: Time Limit Exceeded

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

for i in range(n):
	ts = input()
	ad = True

	for j in s:
		if ts == j:
			ad = False
			break

	if ad :
		s.append(ts)


print(len(s))

Submission status: Time Limit Exceeded

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