이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// 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 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... |