# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
779853 | pedroslrey | Cubeword (CEOI19_cubeword) | C++17 | 793 ms | 10176 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;
using lli = long long;
const int ALPHA = 65;
const int MOD = 998244353;
int cnt[ALPHA][ALPHA];
lli prec[ALPHA][ALPHA][ALPHA];
int ctoord(char c) {
if ('a' <= c && c <= 'z') return c - 'a';
if ('A' <= c && c <= 'Z') return c - 'A' + 26;
return 2*26 + c - '0';
}
lli solve(vector<string> &words) {
if (words.empty()) return 0;
for (int a = 0; a < ALPHA; ++a)
for (int b = 0; b < ALPHA; ++b)
for (int c = 0; c < ALPHA; ++c)
prec[a][b][c] = 0;
for (int a = 0; a < ALPHA; ++a)
for (int b = 0; b < ALPHA; ++b)
cnt[a][b] = 0;
for (string w: words)
++cnt[ctoord(w[0])][ctoord(w.back())];
# | 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... |