Submission #173250

#TimeUsernameProblemLanguageResultExecution timeMemory
173250AkashiAsceticism (JOI18_asceticism)C++14
49 / 100
84 ms56564 KiB
#include <bits/stdc++.h>
using namespace std;

const int MOD = 1e9 + 7;

int n, k;
int d[3005][3005];

int main()
{
    scanf("%d%d", &n, &k);

    d[1][1] = 1;
    for(int i = 2; i <= n ; ++i)
        for(int j = 1; j <= i ; ++j)
            d[i][j] = (1LL * d[i - 1][j] * j + 1LL * d[i - 1][j - 1] * (i - j + 1)) % MOD;

    printf("%d", d[n][k]);

    return 0;
}

Compilation message (stderr)

asceticism.cpp: In function 'int main()':
asceticism.cpp:11: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...