# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
164316 | str0ct | Tents (JOI18_tents) | C++14 | 387 ms | 59384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=1e9+7;
ll dp[3030][3030];
ll f(ll col,ll row){
//printf("%d%d\n",col,row);
if(col<0||row<0)return 0;
if(col==0||row==0)return 1;
if(dp[col][row])return dp[col][row];
dp[col][row]+=(f(col-1,row)+4*row*f(col-1,row-1))%mod;
dp[col][row]%=mod;
dp[col][row]+=(row*(row-1)/2*f(col-1,row-2)+row*(col-1)*f(col-2,row-1))%mod;
dp[col][row]%=mod;
return dp[col][row];
}
int main(){
ll H,W;
scanf("%lld%lld",&H,&W);
printf("%lld",f(H,W)-1);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |