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