# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66104 | polyfish | Palindromic Partitions (CEOI17_palindromic) | C++14 | 213 ms | 44600 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.
//I love armpit fetish
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << " = " << x << '\n';
#define BP() cerr << "OK!\n";
#define PR(A, n) {cerr << #A << " = "; for (int _=1; _<=n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; for (int _=0; _<n; ++_) cerr << A[_] << ' '; cerr << '\n';}
#define FILE_NAME "data"
const int MAX_N = 1000007;
const int MOD = 1000000007;
int n;
string s;
int64_t H[MAX_N], pw26[MAX_N];
void init() {
pw26[0] = 1;
for (int i=1; i<=n; ++i) {
H[i] = (H[i-1] * 26+ s[i] - 'a') % MOD;
pw26[i] = pw26[i-1] * 26 % MOD;
}
}
int64_t get(int l, int r) {
return (H[r] - H[l-1] * pw26[r-l+1] % MOD + MOD) % MOD;
}
# | 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... |