Submission #936843

#TimeUsernameProblemLanguageResultExecution timeMemory
936843johnA Huge Tower (CEOI10_tower)C++14
100 / 100
109 ms8248 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); 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*1LL*(j-i))%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...