Submission #895592

# Submission time Handle Problem Language Result Execution time Memory
895592 2023-12-30T10:44:44 Z Litusiano Cards (LMIO19_korteles) C++14
0 / 100
1000 ms 26392 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
 
#include<bits/stdc++.h>
using namespace std;
// #define int long long
#define s second
#define f first
 
vector<char> find(vector<char> v){
	vector<char> k(4,' ');
	k[3-1] = v[1]; k[4-1] = v[2];
	k[0] = v[3]; k[2-1] = v[4];
	if(k[0] == v[2] && k[2] == v[4] && k[1] == v[1] && k[3] == v[3]) return k;
	return {}; 
}
 
bool check(vector<char> a, vector<char> b){
	if(a[1] == b[3] && a[2] == b[4]) return true;
	if(a[1] == b[2] && a[3] == b[4]) return true;
	if(a[2] == b[4] && a[1] == b[3]) return true;
	if(a[3] == b[1] && a[4] == b[2]) return true;
	return false;
}

signed main(){
	int n; cin>>n;
	map<pair<char,char>,int> m12,m13,m34,m24;
	map<vector<char>,int> m1234,m123, m124, m134, m234;
	int ans = 0;
	vector<vector<char>> v;
	for(int i = 0; i<n; i++){
 
 
		// 100% CHECKED
 
		vector<char> v1(5); cin>>v1[1]>>v1[2]>>v1[3]>>v1[4];
		v.push_back(v1);
		
		
	}
	for(int i = 0; i<n; i++){
		for(int j = i+1; j<n; j++){
			if(check(v[i],v[j])) ans++;
		}
	}
	cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Incorrect 0 ms 436 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Incorrect 0 ms 436 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1102 ms 26392 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 1082 ms 3088 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 432 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -