n=int(input())
c=[]
t=0
for i in range(n):
a=input()
b=input()
c.append([a,b])
for i in range(n):
for j in range(i+1,n):
if c[i][0]==c[j][1] or c[i][1]==c[j][0] or c[i][0][0]==c[j][0][1] and c[i][1][0]==c[j][1][1] or c[j][0][0]==c[i][0][1] and c[j][1][0]==c[i][1][1]:
t+=1
print(t)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2856 KB |
Output is correct |
3 |
Correct |
17 ms |
2904 KB |
Output is correct |
4 |
Correct |
19 ms |
2772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2856 KB |
Output is correct |
3 |
Correct |
17 ms |
2904 KB |
Output is correct |
4 |
Correct |
19 ms |
2772 KB |
Output is correct |
5 |
Correct |
14 ms |
2824 KB |
Output is correct |
6 |
Correct |
170 ms |
2960 KB |
Output is correct |
7 |
Execution timed out |
1070 ms |
3116 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1050 ms |
96704 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
2772 KB |
Output is correct |
2 |
Execution timed out |
1081 ms |
13992 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
2824 KB |
Output is correct |
2 |
Correct |
170 ms |
2960 KB |
Output is correct |
3 |
Execution timed out |
1070 ms |
3116 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |