Submission #164316

#TimeUsernameProblemLanguageResultExecution timeMemory
164316str0ctTents (JOI18_tents)C++14
100 / 100
387 ms59384 KiB
#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); }

Compilation message (stderr)

tents.cpp: In function 'int main()':
tents.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld",&H,&W);
     ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...