# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
242669 | kingfran1907 | Zapina (COCI20_zapina) | C++14 | 382 ms | 5372 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 llint;
const int maxn = 400;
const llint mod = 1e9+7;
int n;
llint dp[maxn][maxn][3];
llint fac[maxn];
llint chos[maxn][maxn];
llint f(int x, int y, bool flag) {
if (x == n + 1) {
if (y == 0) return flag;
else return 0;
}
llint &ret = dp[x][y][flag];
if (ret != -1) return ret;
ret = 0;
for (int i = 0; i <= y; i++) {
ret += chos[y][i] * f(x + 1, y - i, flag || (i == x));
ret %= mod;
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |