답안 #171894

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
171894 2019-12-30T15:07:33 Z arnold518 Asceticism (JOI18_asceticism) C++14
49 / 100
128 ms 94712 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 3000;
const ll MOD = 1e9+7;

int N, K;
ll dp[MAXN+10][MAXN+10];

int main()
{
    int i, j;

    scanf("%d%d", &N, &K);
    dp[1][1]=1;
    for(i=2; i<=N; i++) for(j=1; j<=i; j++) dp[i][j]=(j*dp[i-1][j]+(i-j+1)*dp[i-1][j-1])%MOD;
    printf("%lld", dp[N][K]);
}

Compilation message

asceticism.cpp: In function 'int main()':
asceticism.cpp:18: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 2 ms 508 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 760 KB Output is correct
12 Correct 3 ms 1912 KB Output is correct
13 Correct 3 ms 1960 KB Output is correct
14 Correct 3 ms 1912 KB Output is correct
15 Correct 3 ms 1956 KB Output is correct
16 Correct 3 ms 1912 KB Output is correct
17 Correct 3 ms 1272 KB Output is correct
18 Correct 3 ms 1528 KB Output is correct
19 Correct 2 ms 1016 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 760 KB Output is correct
12 Correct 3 ms 1912 KB Output is correct
13 Correct 3 ms 1960 KB Output is correct
14 Correct 3 ms 1912 KB Output is correct
15 Correct 3 ms 1956 KB Output is correct
16 Correct 3 ms 1912 KB Output is correct
17 Correct 3 ms 1272 KB Output is correct
18 Correct 3 ms 1528 KB Output is correct
19 Correct 2 ms 1016 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 9 ms 8312 KB Output is correct
22 Correct 9 ms 8312 KB Output is correct
23 Correct 9 ms 8440 KB Output is correct
24 Correct 9 ms 8312 KB Output is correct
25 Correct 9 ms 8312 KB Output is correct
26 Correct 9 ms 8312 KB Output is correct
27 Correct 9 ms 8312 KB Output is correct
28 Correct 5 ms 4216 KB Output is correct
29 Correct 3 ms 1272 KB Output is correct
30 Correct 9 ms 8188 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 760 KB Output is correct
12 Correct 3 ms 1912 KB Output is correct
13 Correct 3 ms 1960 KB Output is correct
14 Correct 3 ms 1912 KB Output is correct
15 Correct 3 ms 1956 KB Output is correct
16 Correct 3 ms 1912 KB Output is correct
17 Correct 3 ms 1272 KB Output is correct
18 Correct 3 ms 1528 KB Output is correct
19 Correct 2 ms 1016 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 9 ms 8312 KB Output is correct
22 Correct 9 ms 8312 KB Output is correct
23 Correct 9 ms 8440 KB Output is correct
24 Correct 9 ms 8312 KB Output is correct
25 Correct 9 ms 8312 KB Output is correct
26 Correct 9 ms 8312 KB Output is correct
27 Correct 9 ms 8312 KB Output is correct
28 Correct 5 ms 4216 KB Output is correct
29 Correct 3 ms 1272 KB Output is correct
30 Correct 9 ms 8188 KB Output is correct
31 Runtime error 128 ms 94712 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Halted 0 ms 0 KB -