# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
313720 | bigg | Palindromic Partitions (CEOI17_palindromic) | C++14 | 523 ms | 42732 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
typedef long long ll;
ll hash1[MAXN], hash2[MAXN];
ll pp1[MAXN], pp2[MAXN];
ll p1 = 37, p2 = 101;
pair<ll, ll> subhash(int i, int j){
return make_pair(hash1[i] - (j ? hash1[j - 1] * pp1[i - j + 1] : 0),
hash2[i] - (j ? hash2[j - 1] * pp2[i - j + 1] : 0));
}
string s;
int n;
void resetandin(){
cin >> s;
n = s.length();
hash1[0] = hash2[0] = s[0];
for(int i = 1; i < n; i ++){
hash1[i] = hash1[i-1] * p1 + s[i];
hash2[i] = hash2[i-1] * p2 + s[i];
}
}
int main(){
pp1[0] = pp2[0] = 1;
for(int i = 1; i < MAXN; i++){
pp1[i] = pp1[i-1] * p1;
pp2[i] = pp2[i-1] * p2;
}
# | 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... |