# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211271 | 2020-03-19T21:41:40 Z | bash | Asceticism (JOI18_asceticism) | C++17 | 48 ms | 24952 KB |
#include<bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int n,m; int dp[3005][3005]; int add(int x, int y) { return ((x+y)%mod + mod)%mod; } int mul(int x, int y) { return ((1LL*x*y)%mod + mod)%mod; } int main() { scanf("%d%d",&n,&m); dp[1][1] = 1; for(int x=2;x<=n;x++) { for(int k=1;k<=m;k++) { dp[x][k] = add(mul(x-k+1, dp[x-1][k-1]), mul(k, dp[x-1][k])); } } printf("%d",dp[n][m]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 6 ms | 380 KB | Output is correct |
9 | Correct | 5 ms | 376 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 6 ms | 380 KB | Output is correct |
9 | Correct | 5 ms | 376 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Correct | 5 ms | 768 KB | Output is correct |
12 | Correct | 5 ms | 1536 KB | Output is correct |
13 | Correct | 5 ms | 1536 KB | Output is correct |
14 | Correct | 6 ms | 1664 KB | Output is correct |
15 | Correct | 6 ms | 1920 KB | Output is correct |
16 | Correct | 7 ms | 1920 KB | Output is correct |
17 | Correct | 5 ms | 1152 KB | Output is correct |
18 | Correct | 6 ms | 1536 KB | Output is correct |
19 | Correct | 5 ms | 896 KB | Output is correct |
20 | Correct | 5 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 6 ms | 380 KB | Output is correct |
9 | Correct | 5 ms | 376 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Correct | 5 ms | 768 KB | Output is correct |
12 | Correct | 5 ms | 1536 KB | Output is correct |
13 | Correct | 5 ms | 1536 KB | Output is correct |
14 | Correct | 6 ms | 1664 KB | Output is correct |
15 | Correct | 6 ms | 1920 KB | Output is correct |
16 | Correct | 7 ms | 1920 KB | Output is correct |
17 | Correct | 5 ms | 1152 KB | Output is correct |
18 | Correct | 6 ms | 1536 KB | Output is correct |
19 | Correct | 5 ms | 896 KB | Output is correct |
20 | Correct | 5 ms | 384 KB | Output is correct |
21 | Correct | 6 ms | 4352 KB | Output is correct |
22 | Correct | 6 ms | 4352 KB | Output is correct |
23 | Correct | 12 ms | 6144 KB | Output is correct |
24 | Correct | 13 ms | 6272 KB | Output is correct |
25 | Correct | 18 ms | 8064 KB | Output is correct |
26 | Correct | 18 ms | 8192 KB | Output is correct |
27 | Correct | 18 ms | 8192 KB | Output is correct |
28 | Correct | 10 ms | 4096 KB | Output is correct |
29 | Correct | 5 ms | 1152 KB | Output is correct |
30 | Correct | 19 ms | 8064 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 6 ms | 380 KB | Output is correct |
9 | Correct | 5 ms | 376 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Correct | 5 ms | 768 KB | Output is correct |
12 | Correct | 5 ms | 1536 KB | Output is correct |
13 | Correct | 5 ms | 1536 KB | Output is correct |
14 | Correct | 6 ms | 1664 KB | Output is correct |
15 | Correct | 6 ms | 1920 KB | Output is correct |
16 | Correct | 7 ms | 1920 KB | Output is correct |
17 | Correct | 5 ms | 1152 KB | Output is correct |
18 | Correct | 6 ms | 1536 KB | Output is correct |
19 | Correct | 5 ms | 896 KB | Output is correct |
20 | Correct | 5 ms | 384 KB | Output is correct |
21 | Correct | 6 ms | 4352 KB | Output is correct |
22 | Correct | 6 ms | 4352 KB | Output is correct |
23 | Correct | 12 ms | 6144 KB | Output is correct |
24 | Correct | 13 ms | 6272 KB | Output is correct |
25 | Correct | 18 ms | 8064 KB | Output is correct |
26 | Correct | 18 ms | 8192 KB | Output is correct |
27 | Correct | 18 ms | 8192 KB | Output is correct |
28 | Correct | 10 ms | 4096 KB | Output is correct |
29 | Correct | 5 ms | 1152 KB | Output is correct |
30 | Correct | 19 ms | 8064 KB | Output is correct |
31 | Runtime error | 48 ms | 24952 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
32 | Halted | 0 ms | 0 KB | - |