This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define endl "\n";
bool subsolve(string jeden, string dwa){
if(jeden[0] == dwa[2] && jeden[1] == dwa[3]) return true;
if(jeden[2] == dwa[0] && jeden[3] == dwa[1]) return true;
if(jeden[1] == dwa[0] && jeden[3] == dwa[2]) return true;
if(jeden[0] == dwa[1] && jeden[2] == dwa[3]) return true;
return false;
}
void solve(){
int n, res = 0;
string napis;
cin >> n;
vector<string> lista(n, "");
for(int i = 0; i < n; i++){
cin >> napis;
lista[i] += napis;
cin >> napis;
lista[i] += napis;
}
for(int i = 0; i < n; i++){
for(int j = i + 1; j < n; j++){
res += subsolve(lista[i], lista[j]) ? 1 : 0;
}
}
cout << res << endl;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("input.txt", "r", stdin);
solve();
}
# | 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... |