# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
860432 | rxlfd314 | Tents (JOI18_tents) | C++17 | 130 ms | 35796 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;
#define vt vector
#define size(x) (int((x).size()))
#define all(x) begin(x), end(x)
#define REP(a, b, c, d) for (int a = (b); (d) > 0 ? a <= (c) : a >= (c); a += (d))
#define FOR(a, b, c) REP(a, b, c, 1)
#define ROF(a, b, c) REP(a, b, c, -1)
#define chmax(a, b) a = a > (b) ? a : (b)
#define chmin(a, b) a = a < (b) ? a : (b)
signed main() {
#ifndef DEBUG
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#endif
constexpr int MOD = 1e9 + 7;
int N, M;
cin >> N >> M;
vt<vt<int>> f(N+1, vt<int>(M+1));
fill(all(f[0]), 1);
FOR(i, 0, N)
f[i][0] = 1;
FOR(i, 1, N)
FOR(j, 1, M) {
f[i][j] = f[i][j-1];
(f[i][j] += 4ll * f[i-1][j-1] * i % MOD) %= MOD;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |