# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1097182 | raphaelp | Binaria (CCO23_day1problem1) | C++14 | 188 ms | 28752 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;
const int MAXN = 1e6;
long long fac[MAXN + 1];
long long inv[MAXN + 1];
long long exp(long long x, long long n, long long m)
{
x %= m;
long long ans = 1;
while (n > 0)
{
if (n % 2)
ans = (ans * x) % m;
n /= 2;
x = (x * x) % m;
}
return ans;
}
void precalc(long long p)
{
fac[0] = 1;
for (int i = 1; i <= MAXN; i++)
{
fac[i] = (fac[i - 1] * i) % p;
}
inv[MAXN] = exp(fac[MAXN], p - 2, p);
for (int i = MAXN; i >= 1; i--)
inv[i - 1] = (inv[i] * i) % p;
}
long long choose(int n, int k, int p)
# | 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... |