# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
868698 | vjudge1 | Palindromic Partitions (CEOI17_palindromic) | C++17 | 110 ms | 28568 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;
#define int long long
const int maxn=1e6+7;
const int base=9973;
const int mod=1e9+7;
int pw[maxn], hsh[maxn];
int get(int l, int r)
{
return (hsh[r]-hsh[l-1]*pw[r-l+1]+mod*mod)%mod;
}
void solve()
{
string s; cin >> s;
int N=s.size();
s=' '+s;
for (int i=1; i<=N; i++) hsh[i]=(hsh[i-1]*base+s[i]-'a'+1)%mod;
int l=1, r=N, ans=0;
while (l<=r)
{
if (l==r)
{
ans++;
break;
}
for (int i=l; i<=N/2; i++)
{
Compilation message (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... |