TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
S = list(map(str, input().split()))

color = []

for i in S:
  if i in color:
    pass
  else:
    color.append(i)
    
print(len(color))

N = int(input())
S = list(map(str, input().split()))

color = []

for i in S:
  if i in color:
    pass
  else:
    color.append(i)
    
if len(color) == 4:
  print('Four')
else:
  print('Three')



Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
S = list(map(int,input().split()))
p = S.count("P")
w = S.count("W")
g = S.count("G")
y = S>count("Y")
ans = p+w+g+y
if ans == 3 :
    print("Three")
else :
    print("Four")
    

N = int(input())
S = list(map(str,input().split()))
p = S.count("P")
w = S.count("W")
g = S.count("G")
y = S>count("Y")
ans = p+w+g+y
if ans == 3 :
    print("Three")
else :
    print("Four")
    

N = int(input())
S = list(map(str,input().split()))
S = list(set(S))
p = S.count("P")
w = S.count("W")
g = S.count("G")
y = S.count("Y")
ans = p+w+g+y
if ans == 3 :
    print("Three")
else :
    print("Four")
    

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N=int(input())
S=list(map(int,input().split()))
bucket=[]
for i in range(N):
    if S[i]=='P':
        bucket[0]+=1
    elif S[i]=='W':
        bucket[1]+=1
    elif S[i]=='G':
        bucket[2]+=1
    else:
        bucket[3]+=1
if 4 - bucket.count(0)==3:
    print('Three')
else:
    print('Four')

N=int(input())
S=list(map(str,input().split()))
bucket=[0*i for i in range(4)]
for i in range(N):
    if S[i]=='P':
        bucket[0]+=1
    elif S[i]=='W':
        bucket[1]+=1
    elif S[i]=='G':
        bucket[2]+=1
    else:
        bucket[3]+=1
if 4 - bucket.count(0)==3:
    print('Three')
else:
    print('Four')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
s = list(map(int, input().split()))

print("Four" if "Y" in s else "Three")


n = int(input())
s = list(input().split())

print("Four" if "Y" in s else "Three")


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
if len(set(a))==3:
  print("Three")
else:
  print("Four")

n=int(input())
a=list(input().split())
if len(set(a))==3:
  print("Three")
else:
  print("Four")

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
for a in A:
  if a == 'Y':
    print('Four')
    exit()
print('Three')

N = int(input())
A = input().split()
for a in A:
  if a == 'Y':
    print('Four')
    exit()
print('Three')


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n=int(input())
h=list(map(input().split()))
if len(list(set(h)))==3:
  print("Three")
else:
  print("Four")


n=int(input())
h=list(map(int,input().split()))
if len(list(set(h)))==3:
  print("Three")
else:
  print("Four")

n=int(input())
h=list(input().split())
if len(list(set(h)))==3:
  print("Three")
else:
  print("Four")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N=int(input())
for i in range(N):
  x=int(input())
  if x=="Y":
    print("Four")
    break
else:
  print("Three")
  

N=int(input())
ls=input().split()
for i in range(N):
  x=ls[i]
  if x=="Y":
    print("Four")
    break
else:
  print("Three")
  


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n=int(input())
s=list(input().split())
if 'Y' in s:
    print('four')
else:
    print('three')

n=int(input())
s=list(input().split())
if 'Y' in s:
    print('Four')
else:
    print('Three')

Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
# -*- coding: utf-8 -*-
N = int(input())
a = []
for i in range(1,N+1):
  a.append(input())
  
if a.count("Y") == 0:
  print("Three")
else:
  print("Four")

N = int(input())
S = list(map(int,input().split()))
if S.count("Y") == 0:
  print("Three")
else:
  print("Four")

# -*- coding: utf-8 -*-
N = int(input())
a = []
for i in range(1,N+1):
  a.append(input())
if a.count("Y") == 0:
  print("Three")
else:
  print("Four")

N = int(input())
a = [input() for i in range(1:N)]
if a.count("Y") == 0:
  print("Three")
else:
  print("Four")

N = int(input())
for i in (list(input().split())):
        if i == "Y":
                print("Four")
                exit()

print("Three")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
str = input().split()
print(str)
if 'Y' in str:
    print("Four")
else:
    print("Three")


N = int(input())
str = input().split()
if 'Y' in str:
    print("Four")
else:
    print("Three")

Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = input()
print(len(set(input().split())))

n = input()
print(len(set(input().split()))

n = input()
if len(set(input().split())) == 3:
	print("Three")
else:
	print("Four")  

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
input()
print('Three' if 'Y' in input().split() else 'Four')

input()
print('Four' if 'Y' in input().split() else 'Three')

Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n=input()
a=input().split()
print(("Three","Four")[len(set(a))==4]

n=input()
a=input().split()
print(("Three","Four")[len(set(a))==4])


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
a = list(input())
flag = False
for i in range(n):
  if a[i] == "Y":
    flag = True

if flag == Ture:
  print("Four")
else:
  print("Three")

n = int(input())
a = list(input())
for i in range(n):
  if a[i] == "Y":
    print("Four")
    exit()
    
print("Three")

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):

N=int(input())
l=list(map(int,input().split()))

ln=len(set(l))

if ln==3:
  print('Three')
else:
  print('Four')


N=int(input())
l=list(map(str,input().split()))

ln=len(set(l))

if ln==3:
  print('Three')
else:
  print('Four')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
S = input().split()
print(S)
if len(set(S)) == 3:
  print("Three")
else:
  print("Four")


N = int(input())
S = list(input())
print(S)
if len(set(S)) == 3:
  print("Three")
else:
  print("Four")


N = int(input())
S = input().split()
if len(set(S)) == 3:
  print("Three")
else:
  print("Four")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N=int(input())
S=list(map(str,input().split()))
SS=set(S)
length=len(SS)
print("four" if length==4 else "three")

N=int(input())
S=list(map(str,input().split()))
SS=set(S)
length=len(SS)
print("Four" if length==4 else "Three")

Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
num = int(input())
data = input().rstrip().split(' ')
count = 0
if data.count('P') > 0 or data.count('W') > 0 or data.count('G') > 0 or data.count('Y') > 0:
  count++
print(count)

num = int(input())
data = input().rstrip().split(' ')
count = 0
if data.count('P') > 0 or data.count('W') > 0 or data.count('G') > 0 or data.count('Y') > 0:
  count++

if count == 3:
  print('Three')
elif count == 4:
  print('Four')

N = int(input())
s = input().split()
if "Y" in s:
    print("Four")
else:
    print("Three")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N=int(input())
L=list(map(int,input().split()))
L=set(L)
if len(L)==4:
  print("Four")
else:
  print("Three")

N=int(input())
L=list(input().split())
L=set(L)
if len(L)==4:
  print("Four")
else:
  print("Three")

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
k = len(set(map(str, input().split())))
if k = 4:
  print('Four')
else:
  print('Three')


n = int(input())
k = len(set(map(str, input().split())))
if k == 4:
  print('Four')
else:
  print('Three')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
M = set()
MM = input().split()
for i in MM:
  M.add(i)
print(len(M))
if len(M) == 3:
  print('Three')
else:
  print('Four')

N = int(input())
M = set()
MM = input().split()
for i in MM:
  M.add(i)

if len(M) == 3:
  print('Three')
else:
  print('Four')

Verdicts: Wrong Answer

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
if a.count('Y') == 0:
  print('Three')
else:
  print('Four')

n = int(input())
a = list(map(str, input().split()))
if a.count('Y') == 0:
  print('Three')
else:
  print('Four')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
s = list(input().split())

if len(set(s)) == 3:
  print("Four")
else:
  print("Three")


n = int(input())
s = list[input().split()]

if len(set(s)) == "Y":
  print("Four")
else:
  print("Three")

n = int(input())
for i in range(n):
  s = input():
    if s == "Y":
      print("Four")
      break
    else:
      print("Three")

n = int(input())
s = list(input().split())

if len(set(s)) == 3:
  print("Three")
else:
  print("Four")


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())
ok = False
for i in range(n):
  t = input()
  if(t == 'Y'):
    ok = True
    break
    
if(ok):
  print('Four')
else:
  print('Three')

n = int(input())
t = 'Y'
x = input().split()
    
if(t in x):
  print('Four')
else:
  print('Three')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
S = input().split()

for x in S:
  if x is 'Y'
  	print('Four')
    exit()
  else:
    print('Three')

N = int(input())
S = list(input().split())

print('Four' if 'Y' in S else 'Three')

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
def main(n, s):
    a = set(s)

    if len(a) == 3:
        print('Three')
    elif len(a) == 4:
        print('Four')


if __name__ == "__main__":
    n = int(input())
    s = list(map(int, input().split()))

    main(n, s)


def main(n, s):
    a = set(s)

    if len(a) == 3:
        print('Three')
    elif len(a) == 4:
        print('Four')


if __name__ == "__main__":
    n = int(input())
    s = list(input().split())

    main(n, s)


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
S = set(map(int, input().split()))

print('Three' if len(S) == 3 else 'Four')


N = int(input())
S = set(input().split())

print('Three' if len(S) == 3 else 'Four')


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
N = int(input())
arare = list(map(int, input().rstrip().split()))
count = {"P": 0, "W": 0, "G": 0, "Y": 0}
for i in range(N):
  cur = arare[i]
  if cur == "P":
    count["P"] += 1
  elif cur == "W":
    count["W"] += 1
  elif cur == "G":
    count["G"] += 1
  else:
    count["Y"] += 1
print("Four" if count["Y"] >= 1 else "Three")

N = int(input())
arare = input().rstrip().split()
count = {"P": 0, "W": 0, "G": 0, "Y": 0}
for i in range(N):
  cur = arare[i]
  if cur == "P":
    count["P"] += 1
  elif cur == "W":
    count["W"] += 1
  elif cur == "G":
    count["G"] += 1
  else:
    count["Y"] += 1
print("Four" if count["Y"] >= 1 else "Three")

Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
from collections import Counter
N=input()
c = Counter(list(map(int,input().split())))
if len(c)==4:
  print("Four")
else:
  print("Three")

N = int(input())
A = input().split()

if len(set(A)) <= 3:
    print("Three")
else:
    print("Four")


Verdicts: Runtime Error

Accepted
Problem: In Japan, people make offerings called _hina arare_ , colorful crackers, on March 3.  We have a bag that contains N hina arare. (From here, we call them arare.)  It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.  We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: `P`, white: `W`, green: `G`, yellow: `Y`.  If the number of colors of the arare in the bag was three, print `Three`; if the number of colors was four, print `Four`.

Submission attempts (in order):
n = int(input())

s_list = list(input().split())
s_set = set(s_list)
answer = len(list(s_set))
print('Four' if answer == 3 else 'Three')

n = int(input())

s_list = list(input().split())
s_set = set(s_list)
answer = len(list(s_set))
print('Four' if answer == 4 else 'Three')

Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
import itertools
N = int(input())

num_dic = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
for i in range(N):
    S = input()
    if S[0] in num_dic.keys():
        num_dic[S[0]] += 1

ans = 0
print(num_dic)
for i, j, k in itertools.combinations(num_dic.keys(), 3):
    ans += num_dic[i] * num_dic[j] * num_dic[k]
print(ans)


import itertools
N = int(input())

num_dic = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
for i in range(N):
    S = input()
    if S[0] in num_dic.keys():
        num_dic[S[0]] += 1

ans = 0
for i, j, k in itertools.combinations(num_dic.keys(), 3):
    ans += num_dic[i] * num_dic[j] * num_dic[k]
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
      int n = int.Parse(ReadLine());
      List<string> s = new List<string>();
      
      for (int i=0;i<n;i++)
      {
        s.Add(ReadLine());
      }
      var hashSet = new HashSet<string>(s);
      s = hashSet.ToList();
      List<int> ans = new List<int>();
      
      for (int i=0;i<5;i++)
      {
        ans.Add(0);
      }
      
      for (int i=0;i<s.Count;i++)
      {
        if (s[i].Substring(0,1)=="M")
        {
          ans[0]+=1;
        }
        else if (s[i].Substring(0,1)=="A")
        {
          ans[1]+=1;
        }
        else if (s[i].Substring(0,1)=="R")
        {
          ans[2]+=1;
        }
        else if (s[i].Substring(0,1)=="C")
        {
          ans[3]+=1;
        }
        else if (s[i].Substring(0,1)=="H")
        {
          ans[4]+=1;
        }
      }
      int answ=0;
      for (int i=0;i<5;i++)
      {
        for (int j=i+1;j<5;j++)
        {
          for (int k=j+1;k<5;k++)
          {
            if (i!=j && j!=k && i!=k)
            {
              answ+=ans[i]*ans[j]*ans[k];
            }
          }
        }
      }
      WriteLine(answ);
    }
}

import itertools
n=int(input())
m=list("MARCH")
d=[0]*5
for i in range(n):
  s=input()
  for j in range(len(m)):
    if s[0]==m[j]:
      d[j]+=1
ans=0
for i in list(itertools.combinations(list(range(5)), 3)):
  k=list(i)
  ans+=d[k[0]]*d[k[1]]*d[k[2]]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
N = int(input())

list_pop = [0] * 5
for i in range(N):
    s = input()
    if list(s)[0] == 'M':
        list_pop[0] += 1
    if list(s)[0] == 'A':
        list_pop[1] += 1
    if list(s)[0] == 'R':
        list_pop[2] += 1
    if list(s)[0] == 'C':
        list_pop[3] += 1
    if list(s)[0] == 'H':
        list_pop[4] += 1


print(list_pop)

answer = 0
for i in range(3):
    for j in range(4)[i+1:]:
        for k in range(5)[j+1:]:
            answer += list_pop[i] * list_pop[j] * list_pop[k]
    
    
print(int(answer))

N = int(input())

list_pop = [0] * 5
for i in range(N):
    s = input()
    if list(s)[0] == 'M':
        list_pop[0] += 1
    if list(s)[0] == 'A':
        list_pop[1] += 1
    if list(s)[0] == 'R':
        list_pop[2] += 1
    if list(s)[0] == 'C':
        list_pop[3] += 1
    if list(s)[0] == 'H':
        list_pop[4] += 1




answer = 0
for i in range(3):
    for j in range(4)[i+1:]:
        for k in range(5)[j+1:]:
            answer += list_pop[i] * list_pop[j] * list_pop[k]
    
    
print(int(answer))

Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
N = int(input())
s = [input()[0] for _ in range(N)]
t = []
ans = 0
for k in 'MARCH':
    t.append(s.count(k))
for i in range(32):
    u = []
    for j in range(5):
        u.append(t[j])
    if len(u) == 3:
        ans += u[0]*u[1]*u[2]
print(ans)

N = int(input())
s = [input()[0] for _ in range(N)]
t = []
ans = 0
for k in 'MARCH':
    t.append(s.count(k))
for i in range(32):
    u = []
    for j in range(5):
        if i&(1<<j):
            u.append(t[j])
    if len(u) == 3:
        ans += u[0]*u[1]*u[2]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
import sys
N=int(input())
S=[]
for i in range(N):
    S.append(input()[0])
    
Count=[]
Count.append(S.count("M"))
Count.append(S.count("A"))
Count.append(S.count("R"))
Count.append(S.count("C"))
Count.append(S.count("H"))

Zero=Count.count(0)
if(Zero>=3):print(0)
elif(Zero==2):
    Count.remove(0)
    Count.remove(0)
    pat=1
    for i in Count:pat*=i
    print(pat)
elif(Zero==1):
    Count.remove(0)
    patA=1
    for i in Count:patA*=i
    pat=0
    for i in Count:pat+=patA//i
    print(pat)
elif(Zero==0):
    patA=1
    for i in Count:patA*=i
    pat=0
    for i in range(5):
        for j in range(5):
            if(i==j):continue
            else:
                pat+=patA//Count[i]//Count[j]
    print(pat//2)
print(Count)

import sys
N=int(input())
S=[]
for i in range(N):
    S.append(input()[0])
    
Count=[]
Count.append(S.count("M"))
Count.append(S.count("A"))
Count.append(S.count("R"))
Count.append(S.count("C"))
Count.append(S.count("H"))

Zero=Count.count(0)
if(Zero>=3):print(0)
elif(Zero==2):
    Count.remove(0)
    Count.remove(0)
    pat=1
    for i in Count:pat*=i
    print(pat)
elif(Zero==1):
    Count.remove(0)
    patA=1
    for i in Count:patA*=i
    pat=0
    for i in Count:pat+=patA//i
    print(pat)
elif(Zero==0):
    patA=1
    for i in Count:patA*=i
    pat=0
    for i in range(5):
        for j in range(5):
            if(i==j):continue
            else:
                pat+=patA//Count[i]//Count[j]
    print(pat//2)

Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
n = int(input())
march = {'m': 0, 'a': 0, 'r': 0, 'c': 0, 'h': 0}
for i in range(n):
  s = input()[0]
  try:
    march[s] += 1
  except:
    pass
ans = 0

for key1 in march.keys():
  for key2 in march.keys():
    if key1 != key2:
      for key3 in march.keys():
        if key3 != key1 and key3 != key2:
          ans += key1 * key2 * key3
print(ans)

n = int(input())
march = {'m': 0, 'a': 0, 'r': 0, 'c': 0, 'h': 0}
for i in range(n):
  s = input()[0].lower()
  try:
    march[s] += 1
  except:
    pass
ans = 0

for key1 in march.keys():
  for key2 in march.keys():
    if key1 != key2:
      for key3 in march.keys():
        if key3 != key1 and key3 != key2:
          ans += march[key1] * march[key2] * march[key3]
print(ans//6)

Verdicts: Runtime Error

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
n = int(input().strip())
s = [input().strip() for _ in range(n)]
num = [0 for _ in range(5)]
num[0] = len([True for _s in s if _s[0] == "M"])
num[1] = len([True for _s in s if _s[0] == "A"])
num[2] = len([True for _s in s if _s[0] == "R"])
num[3] = len([True for _s in s if _s[0] == "C"])
num[4] = len([True for _s in s if _s[0] == "H"])
ans = 0
for i in range(5):
    for j in range(i, 5):
        for k in range(j, 5):
            ans += num[i] * num[j] * num[k]
print(ans

def solve(string):
    n, *s = string.split()
    num = [len([True for _s in s if _s[0] == _i]) for _i in "M A R C H".split()]
    ans = 0
    for i in range(5):
        for j in range(i + 1, 5):
            for k in range(j + 1, 5):
                ans += num[i] * num[j] * num[k]
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))


n = int(input().strip())
s = [input().strip() for _ in range(n)]
num_m = len([True for _s in s if _s[0] == "M"])
num_a = len([True for _s in s if _s[0] == "A"])
num_r = len([True for _s in s if _s[0] == "R"])
num_c = len([True for _s in s if _s[0] == "C"])
num_h = len([True for _s in s if _s[0] == "H"])
print(num_m * num_a * num_r + num_m * num_a * num_c + num_m * num_a * num_h + num_m * num_r * num_c
      + num_m * num_r * num_h + num_m * num_c * num_h + num_a * num_r * num_c +
      num_a * num_r * num_h + num_a * num_c * num_h + num_r * num_c * num_h

n = int(input().strip())
s = [input().strip() for _ in range(n)]
num = [0 for _ in range(5)]
num[0] = len([True for _s in s if _s[0] == "M"])
num[1] = len([True for _s in s if _s[0] == "A"])
num[2] = len([True for _s in s if _s[0] == "R"])
num[3] = len([True for _s in s if _s[0] == "C"])
num[4] = len([True for _s in s if _s[0] == "H"])
ans = 0
for i in range(5):
    for j in range(i, 5):
        for k in range(j, 5):
            ans += num[i] * num[j] * num[k]
print(ans)

from functools import reduce
from itertools import combinations
from operator import mul


def solve(string):
    n, *s = string.split()
    # num = [len([True for _s in s if _s[0] == _i]) for _i in "M A R C H".split()]
    initial = "MARCH"
    num = [0 for _ in range(6)]
    for _s in s:
        i = initial.find(_s[0])
        num[i] += 1
    return str(sum([reduce(mul, n) for n in combinations(num[:5], 3)]))


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n)])))


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
#encoding:utf-8

import math
import itertools

n = int(input())
s = []
for i in range(n):
    s.append(str(input()))

chosen_names = {"m":0,"a":0,"r":0,"c":0,"h":0}

for name in s:
    if name[0] == "M":
        chosen_names["m"] += 1
    elif name[0] == "A":
        chosen_names["a"] += 1
    elif name[0] == "R":
        chosen_names["r"] += 1
    elif name[0] == "C":
        chosen_names["c"] += 1
    elif name[0] == "H":
        chosen_names["h"] += 1

answer = 0
capitals = list("march")
capital_set = itertools.com
binations(capitals,3)
for capital in capital_set:
    answer += chosen_names[capital[0]] * chosen_names[capital[1]] * chosen_names[capital[2]]


print(answer)




#     return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))


#encoding:utf-8

import math
import itertools

n = int(input())
s = []
for i in range(n):
    s.append(str(input()))

chosen_names = {"m":0,"a":0,"r":0,"c":0,"h":0}

for name in s:
    if name[0] == "M":
        chosen_names["m"] += 1
    elif name[0] == "A":
        chosen_names["a"] += 1
    elif name[0] == "R":
        chosen_names["r"] += 1
    elif name[0] == "C":
        chosen_names["c"] += 1
    elif name[0] == "H":
        chosen_names["h"] += 1

answer = 0
capitals = list("march")
capital_set = itertools.combinations(capitals,3)
for capital in capital_set:
    answer += chosen_names[capital[0]] * chosen_names[capital[1]] * chosen_names[capital[2]]


print(answer)




#     return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))


Verdicts: Runtime Error

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S1):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)

N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S2):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)


N = int(input())
S ="MARCH"
S2 = [0]*len(S)
n=0

for i in range(N):
    s = input()
    for k, j in enumerate(S):
        if s[0] == j:
            S2[k]+=1
            
for i in range(len(S2)):
    for j in range(i+1,len(S2)):
        for k in range(j+1,len(S2)):
            n +=S2[i]*S2[j]*S2[k]
    
print(n)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
N = int(input())
S = "ACHMR"
dic = {s:0 for s in S}
for _ in range(N):
    s = input()[0]
    if s in S:
        dic[s] += 1
        
        
res = 0
for s0 in S[:3]:
    for s1 in S[1:4]:
        if s0 >= s1:
            continue
        for s2 in S[2:5]:
            if s2 >= s1:
                continue
            res += dic[s0] * dic[s1] * dic[s2]    
print(res)

N = int(input())
S = "MARCH"
dic = {s:0 for s in S}
for _ in range(N):
    s = input()[0]
    if s in S:
        dic[s] += 1
        
print(sum([dic[a] * dic[b] * dic[c] for a in S for b in S for c in S if a < b < c]))


Verdicts: Wrong Answer

Accepted
Problem: There are N people. The name of the i-th person is S_i.  We would like to choose three people so that the following conditions are met:    * The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.   * There are no multiple people whose names begin with the same letter.  How many such ways are there to choose three people, disregarding order?  Note that the answer may not fit into a 32-bit integer type.

Submission attempts (in order):
import sys
input=sys.stdin.readline

h = {}
for c in "MARCH":
    h[c] = 0

n = int(input())
for i in range(n):
    s = input().strip()
    h[s[0]] += 1
#print(h)

import itertools
ans = 0
for i,j,k in itertools.combinations("MARCH", 3):
    ans += h[i]*h[j]*h[k]
print(ans)


import sys
input=sys.stdin.readline

h = {}
for c in "MARCH":
    h[c] = 0

for i in range(int(input())):
    c = input().strip()[0]
    if c in h:
        h[c] += 1

import itertools
ans = 0
for i,j,k in itertools.combinations("MARCH", 3):
    ans += h[i]*h[j]*h[k]
print(ans)


Verdicts: Runtime Error

Accepted