Problem:


Score : 300 points

Problem Statement

You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.

How many kinds of items did you get?

Constraints

1 \leq N \leq 2\times 10^5

S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print the number of kinds of items you got.

Sample Input 1

3
apple
orange
apple

Sample Output 1

2

You got two kinds of items: apple and orange.

Sample Input 2

5
grape
grape
grape
grape
grape

Sample Output 2

1

Sample Input 3

4
aaaa
a
aaa
aa

Sample Output 3

4



Sample input:
3
apple
orange
apple


Sample output:
2

Submission status: Runtime Error

Solution code:
import collections

n = int(input())
a = [list(input() for i in range(n))]
b = collections.Counter(a)
print(len(b))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Solution code:
import sys
s = sys.stdin.readlines()
s = input() .split()
for i in range(1, len(s)):
    s.add(p[i])
print(len(set(s)))

Submission status: Runtime Error

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

list_ss = list_s.sort

int j = 0
for j in list_ss:
    print(list_ss.count(list_s[j]))
    j = j + list_s.count(list_s[j])

Submission status: Runtime Error

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

S = list(S)

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

print(X)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
S = len(s)
l = []

if n>=S:
  for i in range(n):
    l.append(s[i])
    print(len(set(l)))

elif n<S:
  for i in range(S):
    l.append(s[i])
    print(len(set(l)))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
= []
S_append = S.append
S = [input() for _ in range(N)]
count = 0
while len(S) >0:
  S.remove(S[0])
  count += 1
 
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
s_list = [(input().split()) for i in range(n)]
 
ans = []
num = n 
for i in range(n):
  x = s_list.pop()
  ans.append(x)
  if x in s_list:
    s_list = [s for s in s_list if s != x]
    n -= 1
    if n == 0:
      break
    else:
      continue
      
print(len(ans))

Submission status: Runtime Error

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

    N = int(input())
    list = (input() for i in range(N))

    count = ()

    for x in list:
        if x in count:None
        else:count = count + (x,)

    print(len(count))
 if __name__ == "__main__":
     main()

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
= []
S_append = S.append
S = [input() for _ in range(N)]
count = 0
while len(S) >0:
  S.remove(S[0])
  count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i = int(input())
x = set()
for j in range(i):
    x.add(str(input().lower())
print(len(x))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = []

for i in range(n):
  x = s_list.pop()
  ans.append(x)
  if x in s_list:
    s_list = [s for s in s_list if s != x]
    if len(s_list) == 0:
      break
    else:
      continue


print(len(ans))

Submission status: Runtime Error

Solution code:
N =int(input())
P = [input() for i in range(N)]
#print(P)
S = [[] for i in range(N)]
S[0] = int(1)
M = [[] for i in range(N)]
for i in range(N) :
    for j in range(i+1,N) :
        #print (P[i]) 
        #print (P[j])
        li = len(P[i])
        lj = len(P[j])
        #print (li)
        #print (lj)
        if li == lj :
            if M[j] != 1 and P[i] == P[j] :
                S[j] = 0 
                M[j] = 1
            #else :
            #    S[j] = 1
        elif M[j] != 1 : 
            S[j] = 1

#print (M)
#print (S)
ans = int(sum(S))

print (ans)

Submission status: Runtime Error

Solution code:
import sys;


class Main:
    s = set([i.sprit() for i in sys.stdin.readlines()]);

    print(len(s));

Submission status: Runtime Error

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

count = 0
i=0
while S != []:
    temp = len(S)
    S = [s for s in S if s != S[i]]
    print(S)
    if temp > len(S):
        count += 1
        i = 0
        continue
    i +=1
    if i == len(S):
        i = 0
print(count)

Submission status: Runtime Error

Solution code:
a = input().strip()
l = a.split()

m_l = set()
for i in range(1 , n + 1):
    m_l.add(l[i])
print(len(m_l))

Submission status: Runtime Error

Solution code:
import sys
p = []
for l in sys.stdin:
    a.append(int(l))
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Submission status: Runtime Error

Solution code:
import sys
p = []
for l in sys.stdin:
    a.append(l)
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Submission status: Runtime Error

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

for i in list_s:
    print(list_s.count(list_s[i]))

Submission status: Runtime Error

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

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

print(len(list(set(l))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in list_s:
    print(list_s.count(list_s[i]))

Submission status: Runtime Error

Solution code:
n=int(input())
lists=[input() for x in range(n)]
listget=[]
for s in lists:
    for y in range(1,n+1):
        listget.append(s[y])
print(len(set(listget))

Submission status: Runtime Error

Solution code:
import sys
a = []
for l in sys.stdin:
    a.append(l)
p = input() .split()
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

Submission status: Runtime Error

Solution code:
import pandas as pd
n = int(input())
S = []
for _ in range(n):
    S.append(input()) 
df = pd.DataFrame(S)
print(len(pd.unique(df[0])))

Submission status: Runtime Error

Solution code:
d = {}
ans = 0;
N = int(input())
for i in range(N):
    key = input()
    if key not in d:
        ans++
        d[key] = 0
        
        
print(ans)

Submission status: Runtime Error

Solution code:
import pandas as pd
data = input().split()
df = pd.DataFrame(data)
print(len(pd.unique(df[0])))

Submission status: Runtime Error

Solution code:
num = int(input());

for i in range(num):
  s = input();
  if len(s) == 1:
    mylist_1.append(s);
  elif len(s) == 2:
    mylist_2.append(s);
  elif len(s) == 3:
    mylist_3.append(s);
  elif len(s) == 4:
    mylist_4.append(s);
  elif len(s) == 5:
    mylist_5.append(s);
  elif len(s) == 6:
    mylist_6.append(s);
  elif len(s) == 7:
    mylist_7.append(s);
  elif len(s) == 8:
    mylist_8.append(s);
  elif len(s) == 9:
    mylist_9.append(s);
  elif len(s) == 10:
    mylist_10.append(s);
    

m1 = len(list(set(mylist_1)));
m2 = len(list(set(mylist_2)));
m3 = len(list(set(mylist_3)));
m4 = len(list(set(mylist_4)));  
m5 = len(list(set(mylist_5)));
m6 = len(list(set(mylist_6)));
m7 = len(list(set(mylist_7)));
m8 = len(list(set(mylist_8)));
m9 = len(list(set(mylist_9)));
m10 = len(list(set(mylist_10)));

m = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10;
print(m);

Submission status: Runtime Error

Solution code:
import sys

def main():

	N = int(input())
	
	d = {}
	for i in range(N):
		A = int(input())
		d[A] = 0
	print(len(d))
	
if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

print(len(list(set(items)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#coding UTF-8
from collections import Counter
n= int(input())#1行目のNを取得する
l=[input()for i in range(n)] #複数行の数値の入力を取得
c=cCounter(l)

print(len(c))

Submission status: Runtime Error

Solution code:
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Submission status: Runtime Error

Solution code:
import numpy as np

num = int(input());
int count=1;

for i in range(num):
  s = input();
  if len(s) == 1:
    mylist_1.append(s);
  elif len(s) == 2:
    mylist_2.append(s);
  elif len(s) == 3:
    mylist_3.append(s);
  elif len(s) == 4:
    mylist_4.append(s);
  elif len(s) == 5:
    mylist_5.append(s);
  elif len(s) == 6:
    mylist_6.append(s);
  elif len(s) == 7:
    mylist_7.append(s);
  elif len(s) == 8:
    mylist_8.append(s);
  elif len(s) == 9:
    mylist_9.append(s);
  elif len(s) == 10:
    mylist_10.append(s);
    

m1 = len(list(set(mylist_1)));
m2 = len(list(set(mylist_2)));
m3 = len(list(set(mylist_3)));
m4 = len(list(set(mylist_4)));  
m5 = len(list(set(mylist_5)));
m6 = len(list(set(mylist_6)));
m7 = len(list(set(mylist_7)));
m8 = len(list(set(mylist_8)));
m9 = len(list(set(mylist_9)));
m10 = len(list(set(mylist_10)));

m = m1 +m2 +m3 +m4 +m5 + m6 + m7+ m8+ m9+m10;
print(m);

Submission status: Runtime Error

Solution code:
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
c= [input() for i in range(a)]
n = int(c[0])
c.pop(0)

lst = []

for i in range(len(c)):
    if not(c[i] in lst):
        lst.append(i)
print(len(lst))

Submission status: Runtime Error

Solution code:
import collections
num = input()
a = [input() for i in range(num)]
clist = collections.Counter(a)
print(len(clist))

Submission status: Runtime Error

Solution code:
a = int(input())
print(a)
c= [input() for i in range(5)]
print(c)

print(c)
lst = []

for i in range(len(c)):
    if not(c[i] in lst):
        lst.append(c[i])
print(len(lst))

Submission status: Runtime Error

Solution code:
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

Submission status: Runtime Error

Solution code:
list1=[]
num=int(input())
for i in range (0,num):
	some=input()
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Submission status: Runtime Error

Solution code:
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(map(str,input().split()))
a = 0
b = n
c = 0
ans = 0
while a < b:
    gacha = s[a]

    while c < b:
        x = s[c]
        if gacha != x:
            ans += 1
        c += 1
    a += 1
    c = 0

Submission status: Runtime Error

Solution code:
num=int(input())
for i in range (0,num):
	some=input()
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Submission status: Runtime Error

Solution code:
num=int(input())
for i in range (0,num):
	some=input(list1[])
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Submission status: Runtime Error

Solution code:
a=map(int,input().split())
b=list(map(int,input().split()))
def func(a,b):
    ab=set(b)
    return len(ab)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

count = []

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

print(len(count))

Submission status: Runtime Error

Solution code:
num=int(input())
for i in range (0,num):
	some=input(list1[])
    list1.append(some)
print(len(set(i for i in lst if i.isalpha())))

Submission status: Runtime Error

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

N = int(input())

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


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

print(len(count))

Submission status: Runtime Error

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



for i in range(0,n):
    l.append(input())

p = []
p.append(1)
for i in range(1,n):
    count = 0
    for j in range(0,i):
        if l[i] == l[j]:
            count = count+1
        if count == 0:
            p.append(p[i-1] + 1)
        else:
            p.append(p[i-1])        

print(p[n])

Submission status: Runtime Error

Solution code:
def countDistinct(arr, n): 
    res = 1
    for i in range(1, n): 
        j = 0
        for j in range(i): 
            if (arr[i] == arr[j]): 
                break
        if (i == j + 1): 
            res += 1
      
    return res 
  
# Driver Code 
n = int(input())
arr = list(map(string, input().split())) 
print(countDistinct(arr, n))

Submission status: Runtime Error

Solution code:
import pandas as pd

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

data = pd.Series(S)

print(data.nunique())

Submission status: Runtime Error

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


for k in range(N):
  t = input()
  if t not in l:
    ans += 1
    l.append(P[k])

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
S = []
count = 0
for i in range(N):
  S.append(input())
  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: Runtime Error

Solution code:
n = int(input())
s = list(str,input().split())
a = 0
b = n
c = 0
ans = 0
while a < b:
    gacha = s[a]

    while c < b:
        if gacha != s[c]:
            ans += 1
    c += 1
 a += 1
 c = 0

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

S = sorted(S)
count = 0
first = 0
removecount = 0

for i in range(N):
    j = 0
    while first + count + 1 < len(S) :
        if S[first]==S[first+1+j]:
            S[first+1+j] = "nullsad"
            count+=1
            j += 1
            print(S)
        else:
            first += count + 1
            removecount += count
            count = 0
            print(S)
            break

for i in range(removecount + count):
    S.remove("nullsad")

print(len(S))

Submission status: Runtime Error

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

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


for i in range(n):
    s[i] = input()
    leng = len(s[i]) - 1
    
    s_list = list(s[i])
    index = s_list[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][].append(s[i])
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = []
for i in range(N):
    S.append(input())
S.sort()
def hak(S,p,u):
    if p == len(S)-1:
        return u
    
    if S[p] == S[p+1]:
        p += 1
        return hak(S,p,u)
    else:
        u += 1
        p += 1
        return hak(S,p,u)
print(hak(S,0,1))

Submission status: Runtime Error

Solution code:
n = input()

n = int(n)
s = [0]*n
sm = []

for i in range(0,n):
  s[i] = input()

for i in range(0,n):
  c = 1
  sm.insert(0,s[i])
  for j in range(1,len(sm)):
    if(s[i] == sm[j]):
      del sm[0]

print(len(sm))

Submission status: Runtime Error

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= [[[] for j in range(26)] for i in range(26)]
sum=0
for i in range(x):
    si=ns()
    sn1=ord(si[0:1])-97
    sn2=ord(si[1:2])-97
    if si not in s[sn1][sn2]:
       s[sn1][sn2].append(si)
for s1 in s:
    for s2 in s1:
        sum+=len(s2)
print(sum)

Submission status: Runtime Error

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

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


for i in range(n):
    s[i] = input()
    leng = len(s[i]) - 1
    
    s_list = list(s[i])
    index = s_list[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: Runtime Error

Solution code:
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
a = a[1:]
print(len(set(a)))

Submission status: Runtime Error

Solution code:
import pandas as pd
import numpy as np
N = int(input())
keihin = []
for i in range(N):
    keihin.append(input())

nn = np.array(keihin)


print(np.unique(nn).size)

Submission status: Runtime Error

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

c = collections.counter(a)

print(len(c))

Submission status: Runtime Error

Solution code:
N = int(input())

SL = [[],[],[],[],[],[],[],[],[]]

for ss in range(N):
    S = input()

    if not S in SL[len(S)] :
        SL[len(S)].append(S)

SUM = 0

for B in SL:
    SUM += len(B)

print(SUM)

Submission status: Runtime Error

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

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


for i in range(n):
    s[i] = input()
    leng = len(s[i]) - 1
    
    s_list = list(s[i])
    index = s_list[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: Runtime Error

Solution code:
import pandas as pd
import numpy as np


N = int(input())
keihin = []
for i in range(N):
    keihin.append(input())

nn = np.array(keihin)


print(np.unique(nn).size)

Submission status: Runtime Error

Solution code:
N = int(input())
s = [input() for i in range(N)] #複数行の数値の入力を取得
c = collections.Counter(s)
print(len(c))

Submission status: Runtime Error

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

for i in range(N):
  l.append(s[i])
 

print(len(list(set(l))))

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
for _ in range(N):
  A.appen(input())
B = list(set(A))
print(len(B))

Submission status: Runtime Error

Solution code:
N = int(input())
s = [input() for i in range(N)] #複数行の数値の入力を取得
c = collections.Counter(s)
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c = collections.counter(a)

print(len(c))

Submission status: Runtime Error

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

int main(){
    int N;
    cin >> N;
    string S[N];
    for(int i=0;i<N;i++) cin >> S[i];
    int count = 0;
    for(int i=0;i<N;i++){
        if(S[i]!="0"){
            for(int j=i+1;j<N;j++){
                if(S[i]==S[j]) S[j]="0";
            }
        }
    }
    for(int i=0;i<N;i++){
        if(S[i]!="0") count++;
    }
    cout << count << endl;

}

Submission status: Runtime Error

Solution code:
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(len(set(data))-1)

Submission status: Runtime Error

Solution code:
n = int(input())
S = []
A=  []
sum1=0
conut=0
for i in range(0,n):
    a = input()
    S.append(a)
    A.append(S[i])

for i in range(0,n):
    count=A.count(S[i])
    len_A = len(A)
    
    for i in range(0,count):
        A.remove(S[i])
    
    if len(A)!= len_A:
        sum1+=1

    
print(sum1)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <unordered_set> 
#include <vector>
#include <algorithm>

using namespace std;
int main() {
	    int a;
	    cin>>a;
	    unordered_set<string> s;
	    while(a--){
	        string  str;
	        cin>>str;
	        string key=str;
	        	if (!(s.find(key) != s.end())){
	        	    s.insert(str); 
	        	}
	    }
	    cout<< s.size()<<endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
n = int(input())
a = [[""for i in range(10)]for j in range(26)]
dic = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ans = 0
for i in range(n):
    b = input()
    p = dic.index(b[0])
    q = len(b)
    if b not in a[p][q]:
        a[p][q] += b
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
a = input().strip()
l = a.split()
n = int(l[0])
m_l = set()
for i in range(1 , n + 1):
    m_l.add(l[i])
print(len(set(m_l)))

Submission status: Runtime Error

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

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


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

print(count)

Submission status: Runtime Error

Solution code:
p = list((input().split()))
s = set()
for i in range(1, len(p)+1):
    s.add(p[i])
print(len(s))

Submission status: Runtime Error

Solution code:
#include <iostream>

#include <unordered_set> 
#include <vector>
#include <algorithm>

using namespace std;


int main() {
	    int a,b;
	    cin>>a;
	    std::unordered_set<string> s;
	    
	    while(a--){
	        string str;
	        cin>>str;
	        string key=str;
	        	if (!(s.find(key) != s.end())){
	        	    s.insert(str); 
	        	}
	    }
	    cout<< s.size()<<endl;
	return 0;
}

Submission status: Runtime Error

Solution code:
p = list((input().split()))
s = list()
for i in range(1, int(p[0])+1):
    s.append(p[i])
print(len(list(set(s))))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
*b,=map(open(0))
s=set(b)
print(min(a,len(s)))

Submission status: Runtime Error

Solution code:
def countDistinct(arr, n): 
    res = 1
    for i in range(1, n): 
        j = 0
        for j in range(i): 
            if (arr[i] == arr[j]): 
                break
        if (i == j + 1): 
            res += 1
      
    return res 
  
# Driver Code 
n = int(input())
arr = map(string, input().split()) 
print(countDistinct(arr, n))

Submission status: Runtime Error

Solution code:
a = input().strip()
l = a.split()
n = int(l[0])
m_l = []
for i in range(1 , n + 1):
    m_l.append(l[i])
print(len(list(set(m_l))))

Submission status: Runtime Error

Solution code:
n=int(input())
lotter=[]
for i in range(0,n):
	s=input()
	lotter.append(s)

unique_lotter=set{lotter}
print(len(unique_lotter))

Submission status: Runtime Error

Solution code:
n = int(input())
array = [input()]
ans = 1

for i in range(1, n-1):
    tmp = input()
    j = i
    while True:
        j -= 1
        if j==0 or tmp >= array[j-1]:
            break
    if tmp != array[j-1]:
        ans += 1
        array.insert(j, tmp)
print(ans)

Submission status: Runtime Error

Solution code:
p = list((input().split()))
s = []
for i in range(1, int(p[0])):
    s.append(p[i])
print(len(list(set(s))))

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
a.append(input())
for i in range(n-1):
  flag="T"
  b=input()
  for j in range(i+1):
    if b==a[j]:
      flag="F"
      break
  if flag=="T":
    a.append(b)
print(len(a))

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(map(str,input().split()))
l = []

for i in range(N):
  l.append(s[i])
 
print(len(set(l)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#N, M = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
#受け取る数が未定かつリストにしたいとき
#list = list(map(int, input().split()))
#受け取る文字列が未定かつリストにしたいとき
list = '\n'.join(iter(input, ''))
print(len(set(list))-1)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[input() for _ in range(10)]
s=set(b)
print(min(a,len(s)-1) if '' in b else min(a,len(s)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
p = list((input().split()))
s = set()
for i in range(1, int(p[0])):
    s.add(p[i])
print(len(list(s)))

Submission status: Runtime Error

Solution code:
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#N, M = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
#受け取る数が未定かつリストにしたいとき
#list = list(map(int, input().split()))
#受け取る文字列が未定かつリストにしたいとき
list = '\n'.join(iter(input, ''))
print(len(set(list)))

Submission status: Runtime Error

Solution code:
#include <iostream>

#include <vector>
#include <algorithm>

using namespace std;


int main() {
	    int a,b;
	    cin>>a;vector<string> colour;
	    
	    while(a--){
	        string str;
	        cin>>str;
	        string key=str;
	        	if (!(std::find(colour.begin(), colour.end(), key) != colour.end())){
	        	    colour.push_back(str); 
	        	}
	    }
	    cout<< colour.size()<<endl;
	return 0;
}

Submission status: Runtime Error

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=[[],[],[],[],[],[],[],[],[],[]]
sum=0
for i in range(x):
    si=ns()
    sn=len(si)
    if si not in s[sn]:
        s[sn].append(si)
for s1 in s:
    sum+=len(s1)
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
lotter=[]
for i in range(0,n):
	s=input()
	lotter.append(s)

unique_lotter=set{lotter}
unique_lotter_1=list(unique_lotter)
print(len(unique_lotter_1))

Submission status: Runtime Error

Solution code:
p = list((input().split()))
s = set()
for i in range(1, int(p[0])):
    s.add(p[i])
print(len(s))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
N=int(input())
count=0
a=[]
while N>0:
  a.append(input())
  N=N-1
c=collection.Counter(a)
print(len(c))

Submission status: Runtime Error

Solution code:
n = int(input())
list = {}
for x in range(n):
	item = input()
	list[item] = x
print(len(lest))

Submission status: Runtime Error

Solution code:
N=int(input())
list=list(input().split())
list.sort()
n=0
s=list[0]
for i in range(N):
  if list[i] != s:
    n+=1
    s=list[i]
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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]):
      s.remove(a)
    
print(num)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(map(int,input().split()))
l = []

for i in range(N):
  l.append(s[i])
 
print(len(set(l)))

Submission status: Runtime Error

Solution code:
N = int(input())

arr = []

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

print(len(set(arr))

Submission status: Runtime Error

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

Submission status: Runtime Error

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