# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
561165 | fatemetmhr | Palindromic Partitions (CEOI17_palindromic) | C++17 | 310 ms | 28456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define all(x) x.begin(), x.end()
#define fi first
#define se second
const int maxn5 = 1e6 + 10;
ll base[2] = {31, 37};
ll mod[2] = {1000000009, 1000000007};
int hass[2][maxn5], pw[2][maxn5];
inline bool is_eq(int l1, int r1, int l2, int r2){
for(int j = 0; j < 2; j++){
ll tmp1, tmp2;
tmp1 = (mod[j] + hass[j][r1] - (l1 > 0 ? ll(hass[j][l1 - 1]) * pw[j][r1 - l1 + 1] % mod[j] : 0)) % mod[j];
tmp2 = (mod[j] + hass[j][r2] - (l2 > 0 ? ll(hass[j][l2 - 1]) * pw[j][r2 - l2 + 1] % mod[j] : 0)) % mod[j];
if(tmp1 != tmp2)
return false;
}
return true;
}
int main(){
# | 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... |