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;
typedef long long ll;
#define rep(a,b) for(int a = 0; a < (b); ++a)
#define all(t) t.begin(), t.end()
#define pb push_back
const int MAXN = 5e5+5;
int n = 0;
ll wyn = 0;
char A[4][MAXN];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
rep(i,n) rep(j,4) cin >> A[j][i];
rep(i,n)
{
rep(j,i)
{
bool ok = false;
if(A[0][i] == A[2][j] and A[1][i] == A[3][j]) ok = true;
if(A[2][i] == A[0][j] and A[3][i] == A[1][j]) ok = true;
if(A[0][i] == A[1][j] and A[2][i] == A[3][j]) ok = true;
if(A[1][i] == A[0][j] and A[3][i] == A[2][j]) ok = true;
if(ok) ++wyn;
}
}
cout << wyn << '\n';
return 0;
}
# | 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... |