(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #607347

#TimeUsernameProblemLanguageResultExecution timeMemory
607347A_DKangaroo (CEOI16_kangaroo)C++14
0 / 100
0 ms340 KiB
#include <bits/stdc++.h> #define int long long #define ii pair<int,int> #define F first #define S second using namespace std; const int MOD=1e9+7; int dp[2123][2123]; void solve() { int n,s,e; cin>>n>>s>>e; if(s!=1&&e!=1)dp[1][2]=1; else dp[1][1]=1; for(int i=2;i<=n;i++){ for(int j=0;j<=n;j++){ if(i==s||i==e){ if(j>1){ dp[i][j]+=dp[i-1][j-1]; dp[i][j]%=MOD; } dp[i][j]+=dp[i-1][j+1]; dp[i][j]%=MOD; } else{ if(j>2){ dp[i][j]+=dp[i-1][j-2]; dp[i][j]%=MOD; } dp[i][j]+=dp[i-1][j+2]; dp[i][j]%=MOD; } // cout<<dp[i][j]<<" "; } // cout<<"\n"; } cout<<dp[n][0]<<"\n"; } main() { /* ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); // */ int t=1; // cin>>t; while(t--){ solve(); } }

Compilation message (stderr)

kangaroo.cpp:40:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   40 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...