Submission #936841

#TimeUsernameProblemLanguageResultExecution timeMemory
936841johnA Huge Tower (CEOI10_tower)C++14
30 / 100
85 ms11348 KiB
#include <bits/stdc++.h> using namespace std; int main() { std::cout.sync_with_stdio(0); std::cin.tie(0); int n,d; std::cin>>n>>d; std::vector<int> arr(n),combos(n); for (int i = 0; i < n; i++) { std::cin>>arr[i]; } std::sort(arr.begin(), arr.end()); int ans = 1; int j = 0; for (int i = 0; i < n; i++) { while (j<n && arr[i]+d>=arr[j]) { j++; } ans=(ans*(j-i)%1000000009)%1000000009; } std::cout << ans << std::endl; 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...