Submission #535285

#TimeUsernameProblemLanguageResultExecution timeMemory
535285idiotcomputerA Huge Tower (CEOI10_tower)C++11
100 / 100
295 ms11344 KiB
#include <vector> #include <iostream> #include <algorithm> int main(){ int n; long long int d; std::cin >> n >> d; std::vector<long long int> blocks(n); for (int i =0; i < n; i++){ std::cin >> blocks[i]; } std::sort(blocks.begin(),blocks.end()); long long int mod = 1000000009; long long int total = 1; int last = 0; for (int i =0;i < n; i++){ while (blocks[i] - blocks[last] > d){ last += 1; } total = (long long int) (total * (i - last + 1)) % mod; } std::cout << total << '\n'; }
#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...