Submission #899697

#TimeUsernameProblemLanguageResultExecution timeMemory
899697ivazivaA Huge Tower (CEOI10_tower)C++14
0 / 100
1084 ms2644 KiB
#include <bits/stdc++.h> using namespace std; #define MOD 1000000009 #define MAXN 1000010 long long n,d; long long niz[MAXN]; long long val[MAXN]; int main() { cin>>n>>d; for (long long i=1;i<=n;i++) { long long br=0; for (long long j=i-1;j>=1;j--) { if (niz[i]-niz[j]<=d) br++; else break; } val[i]=br; } long long ans=1; for (long long i=1;i<=n;i++) { ans*=(val[i]+1); if (ans>=MOD) ans%=MOD; } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...