Submission #785047

#TimeUsernameProblemLanguageResultExecution timeMemory
785047HanksburgerA Huge Tower (CEOI10_tower)C++17
100 / 100
111 ms11120 KiB
#include <bits/stdc++.h> using namespace std; long long a[1000005], mod=1000000009; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n, d, ans=1; cin >> n >> d; for (long long i=0; i<n; i++) cin >> a[i]; sort(a, a+n); for (long long i=0; i<n; i++) ans=(ans*(i-(lower_bound(a, a+i, a[i]-d)-a)+1))%mod; 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...