# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34119 | natsukagami | 마스코트 (JOI13_mascots) | C++14 | 319 ms | 108216 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 = 3005;
const int mod = 1e9 + 7;
int R, C, N;
int minX = 1e9, maxX = -1e9, minY = 1e9, maxY = -1e9;
int ft[maxn * maxn];
int bc[maxn][maxn];
int f[maxn][maxn];
int cal(int x, int y) {
if (f[x][y]) return f[x][y];
if (x == R && y == C) return 1;
if (x < R)
f[x][y] = (f[x][y] + cal(x + 1, y) * 1LL * ft[y]) % mod;
if (y < C)
f[x][y] = (f[x][y] + cal(x, y + 1) * 1LL * ft[x]) % mod;
return f[x][y];
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> R >> C;
ft[0] = 1;
for (int i = 1; i <= R * C; ++i)
ft[i] = ft[i - 1] * 1LL * i % mod;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |