Submission #553572

#TimeUsernameProblemLanguageResultExecution timeMemory
5535721BeeNY1A Huge Tower (CEOI10_tower)C++17
90 / 100
56 ms2324 KiB
#include <bits/stdc++.h> using namespace std; int n,d,v[100005]; const int mod=1000000009; int main() { cin>>n>>d; for(int i=1; i<=n; i++) cin>>v[i]; sort(v+1,v+n+1); int ways=1,pos=1; for(int i=2; i<=n; i++) { while(pos<i&&v[pos]+d<v[i]) pos++; ways=1LL*ways*(i-pos+1)%mod; } cout<<ways; 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...
#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...