Submission #1091622

#TimeUsernameProblemLanguageResultExecution timeMemory
1091622DottedHawkA Huge Tower (CEOI10_tower)C++17
100 / 100
205 ms10644 KiB
#include <iostream> #include<algorithm> #include <vector> using namespace std; typedef long long ll; int main() { #ifdef LOCAL freopen("IO/input.txt", "r", stdin); #endif ll n,d; cin >> n >> d; vector<ll> V(n); for(auto& x: V) { cin >> x; } sort(V.begin(), V.end()); ll ans = 1; //btwn 7 and 7-d inclusive auto lt = V.begin(); for(auto rt = V.begin(); rt != V.end(); ++rt) { while((*rt - *lt)>d) { ++lt; } ans *= ((rt-lt)+1); ans %= (1000000009); } cout << ans; }
#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...