# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
468382 | thomas_li | Fancy Fence (CEOI20_fancyfence) | C++17 | 107 ms | 4952 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;
typedef long long ll;
typedef pair<int,int> pi;
template <class T, class U> T pow2(T base, U pow) {
T x = 1; while (true) {
if (pow % 2 == 1) x = x * base;
if ((pow /= 2) == 0) break;
base = base * base;
}
return x;
}
template <class T> constexpr bool isPrime(T x) {
if (x < 2) return false;
for (T i = 2; i * i <= x; i++) if (x % i == 0) return false;
return true;
}
template <class T, const T MOD,
#if __cplusplus < 201402L
const bool PRIME_MOD,
#else
const bool PRIME_MOD = isPrime(MOD),
#endif
const bool MUL_OVERFLOW = (numeric_limits<T>::max() / MOD < MOD)>
struct IntMod {
static_assert(is_integral<T>::value, "T must be an integral type");
static_assert(is_signed<T>::value, "T must be a signed type");
static_assert(0 < MOD, "MOD must be a positive integer");
using IM = IntMod<T, MOD, PRIME_MOD, MUL_OVERFLOW>;
T v; IntMod() : v(0) {}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |