# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
140065 | shamimjucse | 회문 (APIO14_palindrome) | C++14 | 70 ms | 36408 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mx = 300005;
int tr[mx][26], node;
int len[mx], link[mx],suff;
string s; /// 1-indexed
int cnt[mx],occ[mx];
inline void Insert(int p)
{
while(s[p - len[suff] - 1] != s[p])
suff = link[suff];
int x = link[suff], c = s[p] - 'a';
while(s[p - len[x] - 1] != s[p])
x = link[x];
if(!tr[suff][c])
{
tr[suff][c] = ++node;
len[node] = len[suff] + 2;
link[node] = (len[node] == 1) ? 2 : tr[x][c];
cnt[node]+=1 + cnt[link[node]];
}
suff = tr[suff][c];
occ[suff]++;
}
void initTree()
{
node = 2, suff = 2;
len[1] = -1, link[1] = 1;
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |