# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1102718 | vjudge1 | Palindromes (APIO14_palindrome) | C++17 | 32 ms | 65880 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 ll = long long;
struct PAM {
// 0 -> even root, 1 -> odd root
static constexpr int ALPHABET_SIZE = 26;
struct Node {
int len, fail;
array<int, ALPHABET_SIZE> next;
Node() : len{}, fail{}, next{} {}
};
vector<int> s;
vector<Node> t;
PAM() { init(); }
void init() {
t.assign(2, Node());
s.clear(); t[1].len = -1;
t[0].len = 0, t[0].fail = 1;
}
int newNode() {
t.emplace_back();
return t.size() - 1;
}
int extend(int p, int c) {
int n = s.size();
s.push_back(c);
while (s[n - t[p].len - 1] != c)
p = t[p].fail;
# | 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... |