Submission #659114

#TimeUsernameProblemLanguageResultExecution timeMemory
659114finn__A Huge Tower (CEOI10_tower)C++17
100 / 100
112 ms10540 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); size_t n; int64_t d; cin >> n >> d; vector<int64_t> blocks(n); for (int64_t &x : blocks) cin >> x; sort(blocks.begin(), blocks.end()); auto it = blocks.begin(), jt = blocks.begin(); int64_t possibilities = 1; while (jt != blocks.end()) { while (it != jt && *jt - *it > d) it++; possibilities = (possibilities * (jt - it + 1)) % 1000000009; jt++; } cout << possibilities << '\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...