# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
172808 | Akashi | Tents (JOI18_tents) | C++14 | 125 ms | 35672 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, m;
int d[3005][3005];
int main()
{
// freopen("1.in", "r", stdin);
scanf("%d%d", &n, &m);
d[0][n] = 1;
for(int c = 1; c <= m ; ++c){
for(int l = 0; l <= n ; ++l){
d[c][l] = d[c - 1][l];
d[c][l] = (d[c][l] + 4LL * (l + 1) * d[c - 1][l + 1]) % MOD;
d[c][l] = (d[c][l] + 1LL * (1LL * (l + 2) * (l + 1) / 2) % MOD * d[c - 1][l + 2]) % MOD;
if(c > 1) d[c][l] = (d[c][l] + (1LL * (m - c + 1) * (l + 1)) % MOD * d[c - 2][l + 1]) % MOD;
}
}
int Sol = -1;
for(int l = 0; l <= n ; ++l)
Sol = (Sol + d[m][l]) % MOD;
printf("%d", Sol);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |