#include <bits/stdc++.h>
using namespace std;
#define endl "\n";
void solve(){
int n, res = 0;
string jeden, dwa;
cin >> n;
vector<string> lista(n, "");
for(int i = 0; i < n; i++){
cin >> jeden >> dwa;
lista[i] += jeden + dwa;
for(int j = i - 1; j >= 0; j--){
if(lista[i][0] == lista[j][2] && lista[i][1] == lista[j][3]) res++;
else if(lista[i][2] == lista[j][0] && lista[i][3] == lista[j][1]) res++;
else if(lista[i][1] == lista[j][0] && lista[i][3] == lista[j][2]) res++;
else if(lista[i][0] == lista[j][1] && lista[i][2] == lista[j][3]) res++;
}
}
cout << res << endl;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("input.txt", "r", stdin);
solve();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
7 ms |
368 KB |
Output is correct |
8 |
Correct |
12 ms |
392 KB |
Output is correct |
9 |
Correct |
24 ms |
396 KB |
Output is correct |
10 |
Correct |
13 ms |
400 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1095 ms |
14548 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
1092 ms |
1876 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
7 ms |
368 KB |
Output is correct |
4 |
Correct |
12 ms |
392 KB |
Output is correct |
5 |
Correct |
24 ms |
396 KB |
Output is correct |
6 |
Correct |
13 ms |
400 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Execution timed out |
1095 ms |
14548 KB |
Time limit exceeded |
13 |
Halted |
0 ms |
0 KB |
- |