# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1135349 | qrn | Palindromic Partitions (CEOI17_palindromic) | C++20 | 5 ms | 6116 KiB |
#include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define pb push_back
#define ins insert
#define ALL(x) x.begin(), x.end()
#define sz(x) x.size()
#define intt long long
// #define endl "\n"
const intt mod = 1e9 + 7;
const intt base = 47;
const intt inf = 1e9;
const intt mxN = 3e5 + 5;
const intt maxA = 1e5 + 5;
const intt L = 23;
vector<intt> pw(mxN), hsh(mxN);
bool check(intt sol, intt sag, intt len) {
intt h1 = (hsh[sol + len - 1] - hsh[sol - 1] + mod) % mod;
intt h2 = (hsh[sag + len - 1] - hsh[sag - 1] + mod) % mod;
return ((h1 * pw[sag - sol]) % mod == h2);
}
# | 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... |