| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1346326 | StefanSebez | Kangaroo (CEOI16_kangaroo) | C++20 | 0 ms | 348 KiB |
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define ll long long
const int N=2010,mod=1e9+7;
int n,a,b;
ll dp[N][N];
int main(){
scanf("%i%i%i",&n,&a,&b);
dp[0][0]=1;
for(int i=1;i<=n;i++)for(int j=1;j<=n;j++){
if(i==a){
dp[i][j]=dp[i-1][j]+dp[i-1][j-1];
}
else if(i==b){
dp[i][j]=dp[i-1][j]+dp[i-1][j-1];
}
else{
dp[i][j]=dp[i-1][j+1]+dp[i-1][j-1];
}
dp[i][j]%=mod;
}
printf("%lld\n",dp[n][1]);
return 0;
}Compilation message (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... | ||||
