# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
838755 | popovicirobert | Palindromes (APIO14_palindrome) | C++14 | 164 ms | 44148 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 ull = unsigned long long;
constexpr int BASE = (int) 1e9 + 7;
constexpr int MAXN = (int) 3e5;
char s[MAXN + 5];
ull pref_hash[MAXN + 5];
ull power[MAXN + 5];
inline ull Get(int l, int r) {
return pref_hash[r] - pref_hash[l - 1] * power[r - l + 1];
}
char str[2 * MAXN + 5];
int len[2 * MAXN + 5];
int Build(char* s, int n) {
power[0] = 1;
for (int i = 1; i <= n; i++) {
pref_hash[i] = pref_hash[i - 1] * BASE + s[i] - 'a' + 1;
power[i] = power[i - 1] * BASE;
}
int size = 0;
str[++size] = '*';
for (int i = 1; i <= n; i++) {
# | 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... |