# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1157289 | SmuggingSpun | Palindromic Partitions (CEOI17_palindromic) | C++20 | 91 ms | 11024 KiB |
#include<bits/stdc++.h>
#define taskname "B"
using namespace std;
typedef long long ll;
const int mod = 2e9 + 33;
const int base = 397;
const int lim = 1e6 + 5;
int hash_value[lim], pw_base[lim];
int get(int l, int r){
return (ll(hash_value[r]) - 1LL * hash_value[l - 1] * pw_base[r - l + 1] + 1LL * mod * mod) % mod;
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
for(int i = pw_base[0] = 1; i < lim; i++){
pw_base[i] = 1LL * pw_base[i - 1] * base % mod;
}
int _t;
cin >> _t;
for(int _ = hash_value[0] = 0; _ < _t; _++){
string s;
cin >> s;
int n = s.size(), ans = 0;
for(int i = 1; i <= n; i++){
hash_value[i] = (1LL * hash_value[i - 1] * base + s[i - 1]) % mod;
}
for(int i = 1; i <= ((n + 1) >> 1); i++){
bool have = false;
컴파일 시 표준 에러 (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... |