Submission #1014860

#TimeUsernameProblemLanguageResultExecution timeMemory
1014860coolbrotherA Huge Tower (CEOI10_tower)C++17
100 / 100
199 ms8852 KiB
#include <iostream> #include <vector> #include <algorithm> #include <climits> #include <set> #include <queue> #include <tuple> using namespace std; int main() { int n, d; cin >> n >> d; vector<int> blocks(n); for (int i = 0; i < n; i++) { cin >> blocks[i]; } sort(blocks.begin(), blocks.end()); long long ans = 1; const int MOD = 1000000009; int j = 0; for (int i = 1; i < n; i++) { while (j < i && blocks[j] < blocks[i] - d) { j++; } ans *= i - j + 1; ans %= MOD; } cout << ans << endl; }
#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...