Submission #202189

# Submission time Handle Problem Language Result Execution time Memory
202189 2020-02-14T05:08:29 Z nvmdava Tents (JOI18_tents) C++17
100 / 100
66 ms 70904 KB
#include <bits/stdc++.h>
long long dp[3005][3005], n, m, i, j;
int main(){
    std::cin>>n>>m;
    for(i = 0; i <= 3000; ++i)dp[i][0] = dp[0][i] = 1;
    for(i = 1; i <= n; ++i)for(j = 1; j <= m; ++j)dp[i][j] = (dp[i - 1][j] + (j >= 2 ? j * (j - 1) / 2 * dp[i - 1][j - 2] : 0) + 4 * j * dp[i - 1][j - 1] + (i >= 2 ? dp[i - 2][j - 1] * j * (i - 1) : 0)) % 1000000007;
    std::cout<<dp[n][m] - 1;
}
# Verdict Execution time Memory Grader output
1 Correct 10 ms 12408 KB Output is correct
2 Correct 11 ms 12408 KB Output is correct
3 Correct 10 ms 12460 KB Output is correct
4 Correct 10 ms 12664 KB Output is correct
5 Correct 10 ms 12536 KB Output is correct
6 Correct 10 ms 12664 KB Output is correct
7 Correct 10 ms 12664 KB Output is correct
8 Correct 11 ms 12536 KB Output is correct
9 Correct 10 ms 12408 KB Output is correct
10 Correct 11 ms 12792 KB Output is correct
11 Correct 11 ms 12536 KB Output is correct
12 Correct 12 ms 13176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 12408 KB Output is correct
2 Correct 11 ms 12408 KB Output is correct
3 Correct 10 ms 12460 KB Output is correct
4 Correct 10 ms 12664 KB Output is correct
5 Correct 10 ms 12536 KB Output is correct
6 Correct 10 ms 12664 KB Output is correct
7 Correct 10 ms 12664 KB Output is correct
8 Correct 11 ms 12536 KB Output is correct
9 Correct 10 ms 12408 KB Output is correct
10 Correct 11 ms 12792 KB Output is correct
11 Correct 11 ms 12536 KB Output is correct
12 Correct 12 ms 13176 KB Output is correct
13 Correct 10 ms 12540 KB Output is correct
14 Correct 11 ms 12536 KB Output is correct
15 Correct 51 ms 56184 KB Output is correct
16 Correct 13 ms 15224 KB Output is correct
17 Correct 19 ms 22136 KB Output is correct
18 Correct 21 ms 24568 KB Output is correct
19 Correct 55 ms 63352 KB Output is correct
20 Correct 49 ms 53112 KB Output is correct
21 Correct 35 ms 39288 KB Output is correct
22 Correct 33 ms 38904 KB Output is correct
23 Correct 24 ms 27128 KB Output is correct
24 Correct 66 ms 70904 KB Output is correct
25 Correct 56 ms 62712 KB Output is correct
26 Correct 60 ms 67340 KB Output is correct
27 Correct 64 ms 69368 KB Output is correct