# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
997422 | vjudge1 | Palindromes (APIO14_palindrome) | C++17 | 40 ms | 44524 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;
int const N=3e5+5;
struct Node
{
int len;
int start,end;
int child[26]={0};
int suffix;
};
Node root1,root2;
Node tree[N];
long long cnt[N];
int curnode,ptr;
string s;
void insert_char(int k){
// cout<<k<<endl;
int tmp=curnode;
while(!(k-tree[tmp].len>=1 && s[k]==s[k-(tree[tmp].len+1)]))
tmp=tree[tmp].suffix;
if(tree[tmp].child[s[k]-'a']!=0){
curnode=tree[tmp].child[s[k]-'a'];
return;
}
ptr++;
tree[tmp].child[s[k]-'a']=ptr;
tree[ptr].len=tree[tmp].len+2;
# | 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... |