Submission #1010184

#TimeUsernameProblemLanguageResultExecution timeMemory
1010184PetrixA Huge Tower (CEOI10_tower)C++17
35 / 100
180 ms12636 KiB
#include <iostream> #include <algorithm> using namespace std; #define MOD 1000000009 long long v[10000001]; int main() { int 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...