# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
169657 | super_j6 | Tents (JOI18_tents) | C++14 | 3 ms | 1148 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 <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define endl '\n'
#define pi pair<int, int>
const long long mod = 1000000007;
const int maxn = 3004;
int n, m;
long long dp[maxn][maxn];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> m;
n += 4, m += 4;
for(int i = 4; i < n; i++){
for(int j = 4; j < m; j++){
dp[i][j] += 4 * (dp[i - 1][j - 1] + 1) % mod;
dp[i][j] %= mod;
dp[i][j] += (j - 4) * (dp[i - 1][j - 2] + 1) % mod + (i - 4) * (dp[i - 2][j - 1] + 1) % mod;
dp[i][j] %= mod;
dp[i][j] += 16 * (i - 4) * (j - 4) % mod * (dp[i - 2][j - 2] + 1) % mod;
dp[i][j] %= mod;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |