Submission #44365

#TimeUsernameProblemLanguageResultExecution timeMemory
44365RayaBurong25_1Asceticism (JOI18_asceticism)C++17
49 / 100
54 ms24984 KiB
#include <stdio.h> #define MOD 1000000007LL long long DP[3005][3005]; int main() { int N, K; scanf("%d %d", &N, &K); int i, j; DP[1][0] = 1; for (i = 1; i <= N; i++) { for (j = 0; j < i && j < K; j++) { // printf("%d %d = %lld\n", i, j, DP[i][j]); DP[i + 1][j] = (DP[i + 1][j] + (j + 1)*DP[i][j])%MOD; DP[i + 1][j + 1] = (DP[i + 1][j + 1] + (i - j)*DP[i][j])%MOD; } } printf("%lld", DP[N][K - 1]); }

Compilation message (stderr)

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