# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
795850 | RushB | Dabbeh (INOI20_dabbeh) | C++17 | 1584 ms | 208528 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 FOR(i, a, b) for (int i = (a); i < (b); i++)
#define int long long
const int64_t INF = 1ll << 60;
const int N = 5e5 + 5;
const int MOD[] = {(int) 1e9 + 7, (int) 1e9 + 9};
const int BASE = 37;
const int LG = 19;
vector<array<int, 2>> hs[N], h[N];
int INV[2][N], lcp[N], P[2][N], n, m, H[2][N], dp[LG][N];
string L, s[N];
array<int, 2> rmq[LG][N];
int inv(int x, const int MOD) {
int re = 1;
for (int b = MOD - 2; b; b >>= 1, x = x * x % MOD) if (b & 1)
re = re * x % MOD;
return re;
}
int get_hash(int i, int l, int r) {
int hsh = H[i][r] - (l ? H[i][l - 1] : 0);
hsh *= INV[i][l];
hsh %= MOD[i];
if (hsh < 0)
hsh += MOD[i];
return hsh;
}
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... |