# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
654802 | NeroZein | Palindromes (APIO14_palindrome) | C++14 | 26 ms | 35208 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 N = 3e5+10;
string s;
int num,suff;
struct node{
int next[26];
int len,num,sufflink;
}tree[N];
inline void ini(){
num = suff = 2;
tree[1].len = -1;tree[1].sufflink = 1;
tree[2].len = 0;tree[2].sufflink = 1;
}
inline void add(int pos){
int cur = suff, curlen = 0;
int let = s[pos]-'a';
while (true){
curlen = tree[cur].len;
if (pos-1-curlen >= 0 && s[pos-1-curlen] == s[pos])
break;
cur = tree[cur].sufflink;
}
if (tree[cur].next[let]){
suff = tree[cur].next[let];
tree[tree[cur].next[let]].num++;
return;
}
# | 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... |