Submission #1010187

#TimeUsernameProblemLanguageResultExecution timeMemory
1010187PetrixA Huge Tower (CEOI10_tower)C++17
100 / 100
203 ms12112 KiB
#include <iostream> #include <algorithm> using namespace std; #define MOD 1000000009 long long v[10000001]; int main() { long long n,m,i,rasp,st; cin>>n>>m; for(i=1;i<=n;i++) cin>>v[i]; sort(v+1,v+n+1); rasp=1;st=1; for(i=1;i<=n;i++){ while(st<i && v[st]+m<v[i]) st++; rasp=(rasp*(i-st+1))%MOD; } cout<<rasp; 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...