# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
493519 | JovanB | Palindromes (APIO14_palindrome) | C++17 | 28 ms | 36620 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;
using ld = long double;
ll res = 0;
const int C = 1000000;
struct PTree{
struct Node{
int len, cnt, slink, dpt, to[26];
} tree[C];
int suf = 0;
int idxx = 0;
string s = "";
void init(){
tree[1].len = -1, tree[1].cnt = 0, tree[1].slink = 1, tree[1].dpt = 0;
tree[2].len = 0, tree[2].cnt = 0, tree[2].slink = 1, tree[1].dpt = 0;
suf = idxx = 2;
}
void addChar(char c){
s += c;
int n = s.size();
while(n - 2 - tree[suf].len < 0 || s[n - 2 - tree[suf].len] != c) suf = tree[suf].slink;
int node = tree[suf].to[c - 'a'];
if(node == 0){
node = ++idxx;
tree[suf].to[c - 'a'] = idxx;
# | 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... |