(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 #122093

#TimeUsernameProblemLanguageResultExecution timeMemory
122093rajarshi_basuKangaroo (CEOI16_kangaroo)C++14
0 / 100
2 ms384 KiB
#include <iostream> #include <vector> #include <set> #include <iomanip> #include <algorithm> #include <functional> #include <stdio.h> #include <cmath> #include <queue> #include <string> #include <map> #include <fstream> #include <complex> #include <stack> #include <set> #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i=a;i<=b;i++) #define ll long long int #define vi vector<int> #define ii pair<int,int> #define pb push_back #define mp make_pair #define ff first #define ss second #define pll pair<ll,ll> #define cd complex<double> #define ld long double #define pld pair<ld,ld> #define iii pair<ii,int> #define vv vector using namespace std; const int MAXN = 2001; const int MOD = 1e9 + 7; ll dp[2001][2001]; int main(){ int n,a,b; cin >> n >> a >> b; FOR(i,n)FOR(j,n)dp[i][j] = 0; a--;b--; dp[0][0] = 1; FOR(i,n){ if(i == 0)continue; FOR(j,i+1){ ll sum = 0; if(i%2 == 0){ FORE(k,j,n-1){ sum += dp[i-1][k]; sum %= MOD; } }else{ FORE(k,0,j-1){ sum += dp[i-1][k]; sum %= MOD; } } dp[i][j] = sum; } } FOR(i,n){ FOR(j,n){ // cout << dp[i][j] << " "; } //cout << endl; } cout << dp[n-1][b] << endl; 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...