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 |
1 |
Correct |
12 ms |
2772 KB |
Output is correct |
2 |
Correct |
13 ms |
2868 KB |
Output is correct |
3 |
Correct |
12 ms |
2804 KB |
Output is correct |
4 |
Correct |
13 ms |
2868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
2772 KB |
Output is correct |
2 |
Correct |
13 ms |
2868 KB |
Output is correct |
3 |
Correct |
12 ms |
2804 KB |
Output is correct |
4 |
Correct |
13 ms |
2868 KB |
Output is correct |
5 |
Incorrect |
13 ms |
2856 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
993 ms |
5640 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
2848 KB |
Output is correct |
2 |
Incorrect |
141 ms |
3136 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
2856 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |