# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
211271 | bash | Asceticism (JOI18_asceticism) | C++17 | 48 ms | 24952 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n,m;
int dp[3005][3005];
int add(int x, int y) {
return ((x+y)%mod + mod)%mod;
}
int mul(int x, int y) {
return ((1LL*x*y)%mod + mod)%mod;
}
int main() {
scanf("%d%d",&n,&m);
dp[1][1] = 1;
for(int x=2;x<=n;x++) {
for(int k=1;k<=m;k++) {
dp[x][k] = add(mul(x-k+1, dp[x-1][k-1]), mul(k, dp[x-1][k]));
}
}
printf("%d",dp[n][m]);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |