# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
598395 | KoD | Genetics (BOI18_genetics) | C++17 | 475 ms | 33692 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 u64 = std::uint64_t;
using u128 = __uint128_t;
constexpr u64 mod = ((u64)1 << 61) - 1;
struct Fp {
u64 x;
Fp(const u64 x = 0) : x(x) {}
Fp& operator+=(const Fp& t) {
x += t.x;
if (x >= mod) x -= mod;
return *this;
}
Fp& operator-=(const Fp& t) {
if (x < t.x) x += mod;
x -= t.x;
return *this;
}
Fp operator*(const Fp& t) const {
const u128 a = (u128)x * t.x;
const u64 b = (a >> 61) + (a & mod);
return b >= mod ? b - mod : b;
}
};
using std::vector;
using std::array;
# | 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... |