Submission #319528

#TimeUsernameProblemLanguageResultExecution timeMemory
319528mosiashvililukaAsceticism (JOI18_asceticism)C++14
4 / 100
1 ms748 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,i,j,ii,jj,zx,xc,dp[3004][3004],mod=1000000007LL; int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>a>>b; dp[1][0]=1; for(i=1; i<a; i++){ for(j=0; j<=min(b,i-1); j++){ dp[i+1][j]+=dp[i][j]*(j+1); dp[i+1][j+1]+=dp[i][j]*(i-j); } } cout<<dp[a][b-1]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...