Submission #1045390

#TimeUsernameProblemLanguageResultExecution timeMemory
1045390bluecornbotA Huge Tower (CEOI10_tower)C++14
55 / 100
1067 ms11264 KiB
#include <iostream> #include <fstream> #include <string> #include <bits/stdc++.h> using namespace std; // ofstream fout ("split.out"); // ifstream fin ("split.in"); int main(){ int n,d; cin>>n>>d; int array[n]; int barray[n]={0}; for(int i=0;i<n;i++){ cin>>array[i]; } sort(array,array+n); int pointeri=n-1; int pointerj=n-2; while(pointerj>=0){ if(pointerj==0){ if(pointeri==1){ if(array[pointerj]+d<array[pointeri]){ pointerj--; } else{ barray[pointeri]++; pointerj--; } } else{ if(array[pointerj]+d<array[pointeri]){ pointeri--; pointerj=pointeri-1; } else{ barray[pointeri]++; pointeri--; pointerj=pointeri-1; } } } else{ if(array[pointerj]+d<array[pointeri]){ pointeri--; pointerj=pointeri-1; } else{ barray[pointeri]++; pointerj--; } } } long long product=1; for(int i=0;i<n;i++){ product*=(barray[i]+1); } cout<<product%1000000009; 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...