Submission #871484

#TimeUsernameProblemLanguageResultExecution timeMemory
871484Sir_Ahmed_ImranKangaroo (CEOI16_kangaroo)C++17
51 / 100
137 ms182792 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> using namespace std; #define ll long long #define li long int #define ld long double #define append push_back #define add insert #define nl '\n' #define ff first #define ss second #define pii pair<int,int> #define pic pair<int,char> #define all(x) (x).begin(),(x).end() #define sum(a) accumulate(all(a),0) #define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL) #define terminator main #define N 201 int mod=1e9+7; int dp[2][N][N][N]; int pre[2][N][N][N]; void solve(){ int n,m,o,p,q,r; pre[0][1][1][1]=1; pre[1][1][1][1]=1; for(int i=2;i<N;i++){ for(int j=1;j<=i;j++){ for(int k=1;k<=i;k++){ if(j!=k) dp[1][i][j][k]=pre[0][i-1][j][k-(k>j)]; pre[1][i][j][k]=(pre[1][i][j-1][k]+dp[1][i][j][k])%mod; } for(int k=i;k>0;k--){ if(j!=k) dp[0][i][k][j]=pre[1][i-1][k-1][j-(j>k)]; pre[0][i][k][j]=(pre[0][i][k+1][j]+dp[0][i][k][j])%mod; } } } cin>>n>>p>>q; cout<<(dp[0][n][p][q]+dp[1][n][p][q])%mod; } int main(){ L0TA; solve(); return 0; }

Compilation message (stderr)

kangaroo.cpp: In function 'void solve()':
kangaroo.cpp:23:11: warning: unused variable 'm' [-Wunused-variable]
   23 |     int n,m,o,p,q,r;
      |           ^
kangaroo.cpp:23:13: warning: unused variable 'o' [-Wunused-variable]
   23 |     int n,m,o,p,q,r;
      |             ^
kangaroo.cpp:23:19: warning: unused variable 'r' [-Wunused-variable]
   23 |     int n,m,o,p,q,r;
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...