| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1306914 | Double_Slash | Asceticism (JOI18_asceticism) | C++20 | 171 ms | 327680 KiB |
#pragma GCC optimize("O3,unroll-loops,inline")
#include <bits/stdc++.h>
#pragma GCC target("avx2")
using namespace std;
using ll = long long;
const int M = 1e9 + 7;
int main() {
int N, K;
cin >> N >> K;
ll dp[N + 1][N]{};
for (int n = 1; n <= N; ++n) {
dp[n][0] = 1;
for (int k = n; --k;) {
dp[n][k] = dp[n - 1][k] * (k + 1) % M + dp[n - 1][k - 1] * (n - k) % M;
}
}
cout << dp[N][K - 1] % M;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
