답안 #62343

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
62343 2018-07-28T07:24:25 Z gusfring Asceticism (JOI18_asceticism) C++14
49 / 100
197 ms 93628 KB
#include <bits/stdc++.h>
using namespace std;
const int N=3003,mod=1e9+7;
int n,k;
long long dp[N][N];
int main(){
    for (int i=1;i<N;i++) dp[i][1]=1;
    for (int j=2;j<N;j++){
        for (int i=j;i<N;i++){
                dp[i][j]=(dp[i-1][j-1]*(i-j+1))%mod;
                dp[i][j]+= j*dp[i-1][j];
                dp[i][j]%=mod;
        }
    }
    scanf("%d %d", &n, &k);
    cout <<dp[n][k];
    return 0;
}

Compilation message

asceticism.cpp: In function 'int main()':
asceticism.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &k);
     ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 46712 KB Output is correct
2 Correct 121 ms 46784 KB Output is correct
3 Correct 120 ms 46892 KB Output is correct
4 Correct 115 ms 46892 KB Output is correct
5 Correct 124 ms 46892 KB Output is correct
6 Correct 116 ms 46932 KB Output is correct
7 Correct 117 ms 46932 KB Output is correct
8 Correct 122 ms 47044 KB Output is correct
9 Correct 130 ms 47044 KB Output is correct
10 Correct 131 ms 47044 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 46712 KB Output is correct
2 Correct 121 ms 46784 KB Output is correct
3 Correct 120 ms 46892 KB Output is correct
4 Correct 115 ms 46892 KB Output is correct
5 Correct 124 ms 46892 KB Output is correct
6 Correct 116 ms 46932 KB Output is correct
7 Correct 117 ms 46932 KB Output is correct
8 Correct 122 ms 47044 KB Output is correct
9 Correct 130 ms 47044 KB Output is correct
10 Correct 131 ms 47044 KB Output is correct
11 Correct 108 ms 47044 KB Output is correct
12 Correct 109 ms 47044 KB Output is correct
13 Correct 108 ms 47044 KB Output is correct
14 Correct 107 ms 47044 KB Output is correct
15 Correct 151 ms 47044 KB Output is correct
16 Correct 105 ms 47044 KB Output is correct
17 Correct 118 ms 47044 KB Output is correct
18 Correct 120 ms 47044 KB Output is correct
19 Correct 101 ms 47044 KB Output is correct
20 Correct 106 ms 47156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 46712 KB Output is correct
2 Correct 121 ms 46784 KB Output is correct
3 Correct 120 ms 46892 KB Output is correct
4 Correct 115 ms 46892 KB Output is correct
5 Correct 124 ms 46892 KB Output is correct
6 Correct 116 ms 46932 KB Output is correct
7 Correct 117 ms 46932 KB Output is correct
8 Correct 122 ms 47044 KB Output is correct
9 Correct 130 ms 47044 KB Output is correct
10 Correct 131 ms 47044 KB Output is correct
11 Correct 108 ms 47044 KB Output is correct
12 Correct 109 ms 47044 KB Output is correct
13 Correct 108 ms 47044 KB Output is correct
14 Correct 107 ms 47044 KB Output is correct
15 Correct 151 ms 47044 KB Output is correct
16 Correct 105 ms 47044 KB Output is correct
17 Correct 118 ms 47044 KB Output is correct
18 Correct 120 ms 47044 KB Output is correct
19 Correct 101 ms 47044 KB Output is correct
20 Correct 106 ms 47156 KB Output is correct
21 Correct 110 ms 47156 KB Output is correct
22 Correct 134 ms 47156 KB Output is correct
23 Correct 127 ms 47156 KB Output is correct
24 Correct 122 ms 47156 KB Output is correct
25 Correct 103 ms 47156 KB Output is correct
26 Correct 107 ms 47172 KB Output is correct
27 Correct 104 ms 47172 KB Output is correct
28 Correct 110 ms 47172 KB Output is correct
29 Correct 159 ms 47172 KB Output is correct
30 Correct 104 ms 47172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 46712 KB Output is correct
2 Correct 121 ms 46784 KB Output is correct
3 Correct 120 ms 46892 KB Output is correct
4 Correct 115 ms 46892 KB Output is correct
5 Correct 124 ms 46892 KB Output is correct
6 Correct 116 ms 46932 KB Output is correct
7 Correct 117 ms 46932 KB Output is correct
8 Correct 122 ms 47044 KB Output is correct
9 Correct 130 ms 47044 KB Output is correct
10 Correct 131 ms 47044 KB Output is correct
11 Correct 108 ms 47044 KB Output is correct
12 Correct 109 ms 47044 KB Output is correct
13 Correct 108 ms 47044 KB Output is correct
14 Correct 107 ms 47044 KB Output is correct
15 Correct 151 ms 47044 KB Output is correct
16 Correct 105 ms 47044 KB Output is correct
17 Correct 118 ms 47044 KB Output is correct
18 Correct 120 ms 47044 KB Output is correct
19 Correct 101 ms 47044 KB Output is correct
20 Correct 106 ms 47156 KB Output is correct
21 Correct 110 ms 47156 KB Output is correct
22 Correct 134 ms 47156 KB Output is correct
23 Correct 127 ms 47156 KB Output is correct
24 Correct 122 ms 47156 KB Output is correct
25 Correct 103 ms 47156 KB Output is correct
26 Correct 107 ms 47172 KB Output is correct
27 Correct 104 ms 47172 KB Output is correct
28 Correct 110 ms 47172 KB Output is correct
29 Correct 159 ms 47172 KB Output is correct
30 Correct 104 ms 47172 KB Output is correct
31 Runtime error 197 ms 93628 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Halted 0 ms 0 KB -