Submission #591966

# Submission time Handle Problem Language Result Execution time Memory
591966 2022-07-08T09:54:10 Z Kacper_Ziemecki Cards (LMIO19_korteles) C++14
36 / 100
1000 ms 14548 KB
#include <bits/stdc++.h>
using namespace std;
#define endl "\n";

void solve(){
	int n, res = 0;
	string jeden, dwa;
	cin >> n;
	vector<string> lista(n, "");
	for(int i = 0; i < n; i++){
		cin >> jeden >> dwa;
		lista[i] += jeden + dwa;
	}
	for(int i = 0; i < n; i++){
		for(int j = i + 1; j < n; j++){
			if(lista[i][0] == lista[j][2] && lista[i][1] == lista[j][3]) res++;
			else if(lista[i][2] == lista[j][0] && lista[i][3] == lista[j][1]) res++;
			else if(lista[i][1] == lista[j][0] && lista[i][3] == lista[j][2]) res++;
			else if(lista[i][0] == lista[j][1] && lista[i][2] == lista[j][3]) res++;
		}
	}
	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
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 8 ms 368 KB Output is correct
8 Correct 13 ms 396 KB Output is correct
9 Correct 24 ms 400 KB Output is correct
10 Correct 13 ms 400 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1099 ms 14548 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 1087 ms 1876 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 8 ms 368 KB Output is correct
4 Correct 13 ms 396 KB Output is correct
5 Correct 24 ms 400 KB Output is correct
6 Correct 13 ms 400 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Execution timed out 1099 ms 14548 KB Time limit exceeded
13 Halted 0 ms 0 KB -