Submission #756851

# Submission time Handle Problem Language Result Execution time Memory
756851 2023-06-12T10:14:25 Z Dan4Life Asceticism (JOI18_asceticism) C++17
49 / 100
38 ms 25016 KB
#include <stdio.h>
long long n,k,d[3010][3010],M=1e9+7;
main(){
    scanf("%lld%lld",&n,&k); d[1][1] = 1;
    for(int i=2;i<=n;i++)
        for(int j=1;j<=k;j++)
            d[i][j]=(d[i-1][j-1]*(i-j+1)+d[i-1][j]*j)%M;
    printf("%lld",d[n][k]);
}

Compilation message

asceticism.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
asceticism.cpp: In function 'int main()':
asceticism.cpp:4:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    4 |     scanf("%lld%lld",&n,&k); d[1][1] = 1;
      |     ~~~~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 672 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1492 KB Output is correct
14 Correct 1 ms 1748 KB Output is correct
15 Correct 2 ms 2132 KB Output is correct
16 Correct 1 ms 2132 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1620 KB Output is correct
19 Correct 1 ms 980 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 672 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1492 KB Output is correct
14 Correct 1 ms 1748 KB Output is correct
15 Correct 2 ms 2132 KB Output is correct
16 Correct 1 ms 2132 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1620 KB Output is correct
19 Correct 1 ms 980 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 2 ms 4308 KB Output is correct
22 Correct 2 ms 4308 KB Output is correct
23 Correct 6 ms 7764 KB Output is correct
24 Correct 7 ms 8160 KB Output is correct
25 Correct 10 ms 11736 KB Output is correct
26 Correct 11 ms 12116 KB Output is correct
27 Correct 11 ms 12104 KB Output is correct
28 Correct 4 ms 5204 KB Output is correct
29 Correct 1 ms 1236 KB Output is correct
30 Correct 11 ms 11732 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 672 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1492 KB Output is correct
14 Correct 1 ms 1748 KB Output is correct
15 Correct 2 ms 2132 KB Output is correct
16 Correct 1 ms 2132 KB Output is correct
17 Correct 1 ms 1108 KB Output is correct
18 Correct 1 ms 1620 KB Output is correct
19 Correct 1 ms 980 KB Output is correct
20 Correct 0 ms 340 KB Output is correct
21 Correct 2 ms 4308 KB Output is correct
22 Correct 2 ms 4308 KB Output is correct
23 Correct 6 ms 7764 KB Output is correct
24 Correct 7 ms 8160 KB Output is correct
25 Correct 10 ms 11736 KB Output is correct
26 Correct 11 ms 12116 KB Output is correct
27 Correct 11 ms 12104 KB Output is correct
28 Correct 4 ms 5204 KB Output is correct
29 Correct 1 ms 1236 KB Output is correct
30 Correct 11 ms 11732 KB Output is correct
31 Runtime error 38 ms 25016 KB Execution killed with signal 11
32 Halted 0 ms 0 KB -