Submission #559568

#TimeUsernameProblemLanguageResultExecution timeMemory
559568PherokungKangaroo (CEOI16_kangaroo)C++14
0 / 100
1 ms212 KiB
#include<bits/stdc++.h> using namespace std; #define N 2005 #define ll long long const int mod = 1e9+7; int n,cs,cf,del; ll dp[N][N],ans; int main(){ scanf("%d%d%d",&n,&cs,&cf); dp[1][1] = 1; for(int idx=2;idx<=n;idx++){ for(int comp=1;comp<=n;comp++){ if(idx == cs || idx == cf){ dp[idx][comp] += dp[idx-1][comp]; dp[idx][comp] %= mod; dp[idx-1][comp-1]; dp[idx][comp] %= mod; del++; } else{ dp[idx][comp] += dp[idx-1][comp-1] * (comp - del); dp[idx][comp] %= mod; dp[idx][comp] += dp[idx-1][comp+1] * (comp); dp[idx][comp] %= mod; } } } printf("%lld",dp[n][1]); }

Compilation message (stderr)

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:18:21: warning: statement has no effect [-Wunused-value]
   18 |     dp[idx-1][comp-1];
      |     ~~~~~~~~~~~~~~~~^
kangaroo.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d%d",&n,&cs,&cf);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...