Submission #935247

#TimeUsernameProblemLanguageResultExecution timeMemory
935247GloriousSpacePotatoA Huge Tower (CEOI10_tower)C++17
0 / 100
86 ms15716 KiB
#include <bits/stdc++.h> #define MOD ((ll) 1e9 + 9) using namespace std; using ll = long long; vector<ll> blocks; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ll n, d; cin >> n >> d; for (ll i{0}; i < n; i++) { ll b; cin >> b; blocks.push_back(b); } sort(blocks.begin(), blocks.end()); ll ans{1}; ll right{0}; for (ll i{0}; i < n; i++) { while (right < n) { if (blocks[i] + d >= blocks[right]) { right++; } else { break; } } ans *= right % MOD; ans %= MOD; } cout << ans << "\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...