This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n=int(input())
c=[]
t=[0 for i in range(5)]
for i in range(n):
a=input()
b=input()
if a=="AA" and b=="AA":
t[0]+=1
elif a=="AA" and b[0]=="A":
t[1]+=1
elif a=="AA" and b[1]=="A":
t[2]+=1
elif a[0]=="A" and b=="AA":
t[3]+=1
else:
t[4]+=1
s=sum(t)
b=0
for i in range(5):
for j in range(i+1,5):
b+=t[i]*t[j]
print(b)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |