# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494400 | jasen_penchev | Brperm (RMI20_brperm) | C++14 | 188 ms | 7608 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 "brperm.h"
#include <iostream>
#define endl '\n'
using namespace std;
const int MAXN = 500000;
const int LOG = 20;
const int BASE = 26;
const int MOD1 = 1000000007;
const int MOD2 = 1000000009;
int n;
int pw[MAXN + 5][2];
struct Hash
{
int len;
int num1, num2;
};
Hash operator + (Hash h1, Hash h2)
{
Hash ret;
ret.len = h1.len + h2.len;
ret.num1 = (1ll * h1.num1 * pw[h2.len][0] + h2.num1) % MOD1;
ret.num2 = (1ll * h1.num2 * pw[h2.len][1] + h2.num2) % MOD2;
return ret;
}
bool operator == (Hash h1, Hash h2)
# | 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... |