# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
589182 | mat_jur | Cards (LMIO19_korteles) | C++14 | 121 ms | 5056 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int A = 27;
int wyst[A][A][A][A];
int main () {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
long long wyn = 0;
for (int i = 1; i <= n; i++) {
string s;
int a, b, c, d;
cin >> s;
a = s[0]-'A'; b = s[1]-'A';
cin >> s;
d = s[0]-'A'; c = s[1]-'A';
int x = 26;
wyn += wyst[d][c][26][26]; //stykaja sie z dolem
wyn += wyst[b][26][26][c]; //stykaja sie z prawa
wyn += wyst[26][26][b][a]; //stykaja sie z gora
wyn += wyst[26][a][d][26]; //stykaja sie z lewa
if (a == c) {
wyn -= wyst[b][x][b][a];
wyn -= wyst[d][c][d][x];
}
# | 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... |