제출 #926166

#제출 시각아이디문제언어결과실행 시간메모리
926166samek08Cards (LMIO19_korteles)C++14
36 / 100
1057 ms4692 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...