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: Wrong Answer

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

a_num = len(a_list)

print(a_num)

Submission status: Wrong Answer

Solution code:
N = int(input())
ct=0
p=0
str_list = [input() for _ in range(N)]
for p in range(N):
	if str_list.index(str_list[p])==p:
		ct=ct+1
	else :
		break

print(ct)

Submission status: Wrong Answer

Solution code:
def main(): #なんか早くなるおまじない
    import sys
    from collections import defaultdict
    dic = defaultdict(int)

    input = sys.stdin.readline #早くなるおまじない

    s = str(input().rstrip())
    m = 0

    for i in range(1, len(s) + 1):
        m_1 = pow(10, i-1) % 2019
        m_add = (int(s[-i]) * m_1) % 2019
        m = (m_add + m) % 2019
        dic[m] += 1

    ans1 = 0

    for x in dic.values():
        if x > 1:
            ans1 += x * (x - 1) // 2
    ans2 = dic[0]

    print(ans1 + ans2)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
dic = {}
cnt =0
for i in  range(n):
    get = input()

    if get not in dic:
        dic[get] = 1

print(len(dic))
print(dic)

Submission status: Wrong Answer

Solution code:
def prb2():
    a,b,c,d = map(int,input().split())
    t = (a+b)
    ak = (c+d)
    print('Yes' if t>ak else "No")

def prb3():
    n = int(input())
    d = dict()
    for i in range(n):
        s = input()
        if s not in d:
            d[s] = 1
        else:
            d[s] += 1
    print(max(d.values()))



#prb1()
#prb2()
prb3()

Submission status: Wrong Answer

Solution code:
from collections import Counter
 
N = int(input())
S = {}
for i in range(N):
  S[i] = input()
print(len(Counter(S.keys()).keys()))

Submission status: Wrong Answer

Solution code:
s=input()
d={}
for i in s.split():
    d[i]=1
print(len(d)-1)

Submission status: Wrong Answer

Solution code:
s=input()
s.split()
d={}
for i in s.split():
    d[i]=1
print(len(d)-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter


def main():
  scan = sys.stdin.readline
  
  n = int(scan().rstrip())
  s = scan().rstrip().split()
  
  print(len(Counter(s)))


if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
def main():

    N = int(input())

    S = []
    for i in range(N):
        S.append(input())
    
    sorted_S = sorted(S)

    now_name = sorted_S[0]
    ans = 1
    for i in range(N):
        if now_name != sorted_S[i]:
            ans += 1
    
    print('{}'.format(ans))



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():

    N = int(input())

    S = []
    for i in range(N):
        S.append(input())
    
    now_name = S[0]
    ans = 1
    for i in range(N):
        if now_name != S[i]:
            ans += 1
    
    print('{}'.format(ans))



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
for i in range(len(S)):
  if int(S[i]) <= 1:
    for j in range(i+1,i+7):
      if int(S[i:j]) % 2019 == 0 and int(S[i:j]) != 0:
        count = count + 1
        if j >= len(S):
          break
  if int(S[i]) >= 2:
    if int(S[i:i+6]) == 200000:
      for j in range(i+1,i+7):
        if int(S[i:j]) % 2019 == 0 and int(S[i:j]) != 0:
          count = count + 1
          if j >= len(S):
            break
    else:
      for j in range(i+1,i+6):
        if int(S[i:j]) % 2019 == 0 and int(S[i:j]) != 0:
          count = count + 1
          if j >= len(S):
            break
print(count)

Submission status: Wrong Answer

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
  n = n - 1

print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = []
S = input()
for i in range(N-1):
    l.append(S)
    S = input()
l = set(l)
a=0
for j in l:
    a +=1
print(a)

Submission status: Wrong Answer

Solution code:
import sys
t=[]
for line in sys.stdin.readlines():
    #a=line.rstrip()
    #print(a)
    
    t.append(line.rstrip())

i=1
j=1
ans=[]
while i<=int(t[0]):
    k=0
    while j<=int(t[0]):
        
        j=j+1
        
        if j>int(t[0]):
            break
        if t[i]!=t[j]:
            ans.append(t[i])
        k=k+1
    j=1
    i=i+1
    j=j+i-1
if len(ans)==0:
    a=len(ans)+1
else:
    a=len(ans)
print(a)

Submission status: Wrong Answer

Solution code:
def abc():
    N=int(input())
    str=""
    sum=0
    for i in range(N):
        str1=input()+","
        str=str+str1
    for i in range(1,N):
        for j in range(i-1):
            if(str[2*j]==str[2*i]):
                sum+=1
                continue
    rest=N-sum
    
    print(rest)


abc()

Submission status: Wrong Answer

Solution code:
import itertools
s = input()
s_li = list(s)
lee = len(s_li)

count = 0
keta = list(itertools.combinations([i for i in range(lee)], 2))
for k in keta:
    lk = list(k)
    #print(s_li[lk[0]:lk[1]+1])
    if int(''.join(s_li[lk[0]:lk[1]+1]))%2019 == 0:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
S = list(input().split())
c = Counter(S)
print(len(c))

Submission status: Wrong Answer

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]):
                        break
        if(flg ==0):
                cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
p = input()
a = p.strip()
l = a.split()
print(len(set(l)) - 1)

Submission status: Wrong Answer

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]:
            N = N - 1

print(N)

Submission status: Wrong Answer

Solution code:
import math

def main():
    n = input()
    s = {}
    print(n)
    while int(n)>0:
        m = input()
        if m in s:
            s[m]+=1
        else:
            s[m]=1
        n = int(n) - 1
    print(len(s))
    return 0

main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans_list = []
for i in range(n):
    s = input()
    if i == 0:
        ans_list.append(s)
    else:
        L = -1
        U = len(ans_list)-1
        while U - L > 1:
            x = (L + U) // 2
            if ans_list[x] >= s:
                U = x
            else:
                L = x
        if ans_list[U] == s:
            continue
        else:
            ans_list.insert(U, s)
print(len(ans_list))

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    data = ['']
    low = 0
    high = 1
    count = 0
    key = 0
    for i in range(n - 1):
        per = input()
        while(high - low > 1):
            center = (high + low) // 2
            if(data[center] == per):
                key = 1
                break
            elif(data[center] > per):
                high = center
            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: Wrong Answer

Solution code:
a = input().strip()
l = a.split()
print(len(set(l)) - 1)

Submission status: Wrong Answer

Solution code:
num = int(input())
a = list()
for i in range(num):
    string = input()
    a.append(string)
    d = set(a)
print(d)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list()
p = list()
for _ in range(N):
    a.append(input())
for x in range(N):
    p.append(a.count(a[x]))
print(max(p))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
List = [input() for i in range(N)]
count_str = N
for i in range(N-1):
    j = i+1
    if List[i] == List[j]:
        count_str = count_str - 1
    else:
        pass
print(count_str)

Submission status: Wrong Answer

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

if N==0:
  print(0)
  
S_div.append(S[0])
count+=1

for i in S:
  for j in range(count):
    if i == S_div[j]:
      break
    S_div.append(i)
    count+=1
  else:
    continue
      
  
else:
  print(count)

Submission status: Wrong Answer

Solution code:
num = int(input())
targets = []
targetl = []
hit = 0
for j in range(num):
    check = input()
    long = len(check)
    if long <= 5:
        if check not in targets:
            targets.append(check)
            hit += 1
    elif long >= 6:
        if check not in targets:
            targetl.append(check)
            hit += 1
print(hit)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [str(input()) for i in range(N)] 
count=0
while len(list)>0:
  s = list[0]
  list.remove(s) 
  count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import sys;


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

    print(len(s));

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())
import re
a= [input() for i in range(s)]

count = 1

for i in range(s-1):
  if a[i] != a[i+1]:
      count += 1
count

Submission status: Wrong Answer

Solution code:
import sys;


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

    print(len(s));

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list()
num = 1


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

for i in range(N):
    for j in range(i+1,N):
        if i == j:
            break
        elif S[i] != S[j]:
            num += 1
            break

print(num)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys;
class Main:
    
    s = set([i.strip() for i in sys.stdin.readlines()]);
    
    print(len(s));

Submission status: Wrong Answer

Solution code:
newlst = []
lst =[]
m = int(input())
while(m<0):
    a = str(input())
    lst.append(a)
    m = m -1
for j in lst:
    if j not in newlst:
        newlst.append(j)
print(len(newlst))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(len(S))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [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 -= 1
    break
print(count)

Submission status: Wrong Answer

Solution code:
n = int(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: Wrong Answer

Solution code:
a = int(input())
data = []
ans = 0
flag = 1
for i in range(a):
  tar = input()
  for j in data:
    if tar == j:
      flag = 0
  if flag:
    ans += 1
    data.append(tar)
   
  
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

S = input()
lis_2019 = [2019 * i for i in range(1, 99)]
cnt = 0
S_len = len(S)
cnt_1 = 0
S_lis = [S]

for i in range(4, S_len):
    while cnt_1 != S_len - i + 1:
        #print(S[cnt_1:cnt_1+1+i])
        S_lis.append(S[cnt_1:cnt_1+i])
        cnt_1 += 1
    cnt_1 = 0

for i in S_lis:
    for j in lis_2019:
        if str(i) == str(j):
            cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
num=int(input())
count=0
temp=""
while(num):
    something = input()
    if(temp!=something):
        count+=1
        temp=something
    num-=1
print(count)

Submission status: Wrong Answer

Solution code:
num=int(input())
lst=[]
if 1<=num<=2*10**5:
    lst=[input() for i in range(num)]
    print(lst)
    print(len(set(lst)))

Submission status: Wrong Answer

Solution code:
N = int(input())
l = []
for i in range(N):
    l.append(input())
k = sorted(l)
ans = 0
for i in range(N):
    a = 0
    if k[i]!=a:
        ans+= 1
        a = k[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import collections
num = int(input())
a = input().split()
clist = collections.Counter(a)
print(len(clist))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
l = []
for i in range(N):
    l.append(input())
k = sorted(l)
ans = 0
for i in range(N):
    a = 0
    if l[i]!=a:
        ans+= 1
        a = l[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
l = []
for i in range(N):
    l.append(input())
k = np.array(l)
ans = 0
for i in range(N):
    a = 0
    if k[np.argsort(k)[i]]!=a:
        ans+= 1
        a = k[np.argsort(k)[i]]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
r=0
l=[]
for i in range(n):
  l.append(input())
l.sort()
for i in range(n-1):
  if l[i]!=l[i+1]:
    r+=1
  
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
a = input().strip().split()
number = a.pop(0)
clist = collections.Counter(a)
print(len(clist))

Submission status: Wrong Answer

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

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

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

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list()
num = 1


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

for i in range(N):
    for j in range(N):
        if i == j:
            break
        elif S[i] != S[j]:
            num += 1
            break

print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = [input()]
count=1
for i in range(N-1):
    s = input()
    ind = 0
    for j in range(len(list)):
        if s == list[j]:
            break
        if s != list[j]:
            ind +=1
    if ind == len(list):
        list.append(s)
        count+=1
    if count == 10:
        break
print(count)

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
l = len(s)
for i in range(l):
    for j in range(i+1, l+1):
        if j-i<4:
            continue
        tmp = int(s[i:j])
        if (tmp % 2019 == 0):
            count+=1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

num=int(input())
lst=[x for x in range(num)]
c=collections.Counter(lst)
print(len(c))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list()
num = 1


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

for i in range(N):
    for j in range(N-1):
        if i == j:
            break
        elif S[i] != S[j]:
            num += 1
            break

print(num)

Submission status: Wrong Answer

Solution code:
c=list(map(str,input().split()))
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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import random

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 random.choice(keihin):
            p_c=p_c+1
            if j == present:
                break
            if p_c == len(keihin):
                keihin = np.append(keihin, present)
                count = count + 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

list = [S[0]]
count = 1;
for i in range(n):
    for j in range(len(list)):
        if list[j] == S[i]:
            break
        if j == len(list)-1:
            count += 1
print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import sys

s = sys.stdin.readlines()
n = int(s[0][:-1])

dct={}
cnt = 0
for i in range(1, n):
  if s[i][:-1] not in dct.keys():
    dct[s[i][:-1]] = 1
    cnt += 1

if n > 1:
  if s[n] not in dct.keys():
    dct[s[n]] = 1
    cnt += 1


print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c=list(map(str,input().split()))
n = int(c[0])
c.pop(0)

lst = []

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

Submission status: Wrong Answer

Solution code:
n = int(input())
items = [x for x in input().split()]

print(len(set(items)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
S_list = np.zeros(N,dtype=str)
for i in range(N):
  S_list[i] = input()
print(len(np.unique(S_list)))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
from collections import Counter
a = int(input())

list = [input() for i in range(a)]

print(list)
print(len(Counter(list)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
import sys

s = sys.stdin.readlines()
n = int(s[0][:-1])

dct={}
cnt = 0
for i in range(1, n):
  if s[i][:-1] not in dct.keys():
    dct[s[i][:-1]] = 1
    cnt += 1

if s[n] not in dct.keys():
  dct[s[n]] = 1
  cnt += 1


print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
g=[]
for i in range(n):
  gi=input()
  g.append(gi)  
g.sort()
count=1
for i in range(n-1):
  if g[i]!=g[i+1]:
    count+=1
print(g)
print(count)

Submission status: Wrong Answer

Solution code:
b = input().strip()
a = b.split()
a.pop(0)
print(len(set(a)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input().split()
s=set(a[1:])
print(len(s))

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
ans=0
for i in range(n-3):
  for j in range(i+3,n+1):
    if int(s[i:j])%2019==0:
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
x=0
if len(s)<=3:
    x=0
    print(x)
else :
    for j in range(len(s)):
        count=0
        for i in range(len(s)-j):
            a="".join(s[j:j+count+1])
            if int(a) % 2019 ==0:
                x+=1
                count+=1
            else:
                count+=1
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

base1 = 1007
mod1 = 10**9+7
dic = {}

for s in S:
  for i,e in enumerate(s):
      n = len(s)
      hash1 = [0]*(n+1)
      power1 = [1]*(n+1)
      hash1[i+1] = (hash1[i]*base1 + ord(e))%mod1
      power1[i+1] = (power1[i]*base1)%mod1
  key = hash1[n]
  dic.setdefault(key, s)

print(len(dic))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [input() for i in range(N)]
i = 0
cnt = 0
kind = 0
while(cnt < N):
    cnt += S.count(S[i])
    kind += 1
    i += 1
print(kind)

Submission status: Wrong Answer

Solution code:
s = input()
c = 0

for j in range(len(s)-1):
    for i in range(j+3, len(s)):
        if int(s[j:i+1]) % 2019 == 0:
            c = c + 1

print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1, n):
    tmp = input()
    j = ans
    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: Wrong Answer

Solution code:
import sys
n = int(input())
s = sys.stdin.readlines()
s[n-1] += "\n"
print(len(set(s)))

Submission status: Wrong Answer

Solution code:
K = int(input())
L = []
for i in range(1,K+1):
    t =input()
    L.append(t)
print(len(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

len(set(s_list))

Submission status: Wrong Answer

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

for i in range(N):
  a.append(input())
  
b = set(a)
print(len(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S_set = list(set(S))



print(len(S))

Submission status: Wrong Answer

Solution code:
N = int(input()) 
s = [input() for i in range(N)] 
print(s) #出力：['s_1', 's_2', 's_3', 's_N']
print(len(set(s)))

Submission status: Wrong Answer

Solution code:
#multiple 
line = input()
n = len(line)
total = 0
for i in range(n-3):
    for j in range(i +3,n):
        if int(line[i:j+1])%2019 == 0:
            total +=1
            
print(total)

Submission status: Wrong Answer

Solution code:
import sys
import os

def file_input():
    f = open('../Beginner_Contest_164/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # A,B,C,D=map(int, input().split())
    N = int(input())

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

    S = {}
    val=0
    for i in range(N):
        str = input()
        if S.get(str) == None:
            S[val]=str
            val+=1

    print(val)

    # val = 0
    # str = ""
    # for i in range(N):
    #     in_str = input()
    #     if str.find(in_str):
    #         str += " "+in_str
    #         val += 1
    #
    # print(val)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=list(input().split())
s=set(a[1:])
print(len(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
sequence = [input() for _ in range(n)]
ans = 0
while True:
    if len(sequence) == 0:
        break
    a = sequence[0]
    sequence.remove(a)
    ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = []
for _ in range(N):
    l.append(input())

print(len(l))

Submission status: Wrong Answer

Solution code:
hoge = input().split()
print(len(set(hoge)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
A = N
S = []
for i in range(N):
    S += [input()]
for j in range (1, N):
    for k in range(j):
        if S[k] == S[j]:
            A -= 1
            break
print(S)
print(A)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=input()
cnt=0
for i in range(len(s)-3):
  for j in range(i+3,len(s)):
    t=int(s[i:j+1])
    if t%2019==0:
      cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
S = sys.stdin.readlines()[1:]
S[-1] = S[-1] + '\n'
list = []
for i in range(len(S)):
  if S[i] not in list:
    list.append(S[i])
print(len(list))

Submission status: Wrong Answer

Solution code:
n = int(input())

s = []

kinds =0

for i in range(n):
  temp =input()
  for j in s:
    if j == temp:
      break
  else:
    s.append(temp)
    continue
  break
  
print(len(s))

Submission status: Wrong Answer

Solution code:
import sys
import os

def file_input():
    f = open('../Beginner_Contest_164/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # A,B,C,D=map(int, input().split())
    N = int(input())

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

    val = 0
    str = ""
    for i in range(N):
        in_str = input()
        if str.find(in_str):
            str += " "+in_str
            val += 1

    print(val)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

l = list()
for num in range (1,n+1):
    l.append(input())

answer = [x for x in set(l) if l.count(x) > 1]
print(len(answer))

Submission status: Wrong Answer

Solution code:
num = int(input()) - 1
j = 0
target = input()
hit = 1
x = 0
while j <= num - 1:
    check = input()
    if target in check and len(target) == len(check):
        x+=1
    else:
        hit +=1
        target = check    
    j += 1
print(hit)

Submission status: Wrong Answer

Solution code:
b=int(input())
a=set(input().split())
print(len(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
s = [str(e) for e in input().split()]
print(len(Counter(s)))

Submission status: Wrong Answer

Solution code:
import collections

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

c = collections.Counter(l)
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = set({})
count = 0
for i in range(N):
    L.add(input())
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())

mydic={"",0}

for i in range(n):
    a=input()
    mydic.update(a)

print(mydic)
print(len(mydic)-2)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
list=[]
for i in range(N):
  if str(input()) in list:
    pass
  else:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for n in range(N):
    S.append(input())
    
S2 = set(S)
ans = 0
for str in S:
    ans += 1
    if str in S2:
        S2.remove(str)
        if (len(S2) == 0):
            break;
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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