# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
431278 | keko37 | Tents (JOI18_tents) | C++14 | 205 ms | 63340 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 MOD = 1000000007;
typedef long long llint;
const int MAXN = 3005;
int add (int a, int b) {a += b; if (a >= MOD) return a - MOD; return a;}
int sub (int a, int b) {a -= b; if (a < 0) return a + MOD; return a;}
int mul (int a, int b) {return (llint) a * b % MOD;}
int n, m;
int fact[MAXN], pot[MAXN];
int nck[MAXN][MAXN], dp[MAXN][MAXN];
void precompute () {
fact[0] = 1;
pot[0] = 1;
for (int i = 1; i < MAXN; i++) {
fact[i] = mul(fact[i - 1], i);
pot[i] = mul(pot[i - 1], (MOD + 1) / 2);
}
for (int i = 0; i < MAXN; i++) {
nck[i][0] = nck[i][i] = 1;
for (int j = 1; j < i; j++) {
nck[i][j] = add(nck[i - 1][j], nck[i - 1][j - 1]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |