Submission #590286

#TimeUsernameProblemLanguageResultExecution timeMemory
590286aspiranekCards (LMIO19_korteles)C++17
36 / 100
1089 ms27996 KiB
// Autor: Adam Szymaszkiewicz
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);

	int n;
	cin >> n;
	vector<vector<char>> v(n, vector<char>(4));
	for (int i = 0; i < n; i++)
	{
		string a, b;
		cin >> a >> b;
		v[i][0] = a[0];
		v[i][1] = a[1];
		v[i][2] = b[0];
		v[i][3] = b[1];
	}
	// for (int i = 0; i < n; i++)
	// {
	// 	for (int j = 0; j < 4; j++)
	// 		cout << v[i][j] << " ";
	// 	cout << "\n";
	// }
	int wyn = 0;
	for (int i = 0; i < n; i++)
		for (int j = i+1; j < n; j++)
		{
			// cout << i << " " << j << "\n";
			if ((v[i][0] == v[j][2] && v[i][1] == v[j][3])\
			 || (v[i][2] == v[j][0] && v[i][3] == v[j][1])\
			 || (v[i][0] == v[j][1] && v[i][2] == v[j][3])\
			 || (v[i][1] == v[j][0] && v[i][3] == v[j][2]))
				wyn++;
		}
	cout << wyn << "\n";
}
#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...