Submission #48230

#TimeUsernameProblemLanguageResultExecution timeMemory
48230kawaiigrabrielnekoAsceticism (JOI18_asceticism)C++14
49 / 100
105 ms93784 KiB
#include <cstdio>
#include <algorithm>
using namespace std;

long long dp[3009][3009];

int main(){
    int N, K;
    scanf("%d %d", &N, &K);
    dp[1][1] = 1;
    for (int n = 2; n <= N; n++){
        for (int k = 1; k <= n; k++){
            dp[n][k] = (k*dp[n-1][k]+ (n-k+1)*dp[n-1][k-1])%1000000007L;
        }
    }
    printf("%d", dp[N][K]);
}

Compilation message (stderr)

asceticism.cpp: In function 'int main()':
asceticism.cpp:16:26: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
     printf("%d", dp[N][K]);
                  ~~~~~~~~^
asceticism.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &K);
     ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...