Submission #1125510

#TimeUsernameProblemLanguageResultExecution timeMemory
1125510njoopA Huge Tower (CEOI10_tower)C++17
100 / 100
130 ms5312 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int n, d, arr[1000010], dp[1000010], ans=1, mod=1e9+9; signed main() { cin.tie(0)->sync_with_stdio(0); cin >> n >> d; for(int i=0; i<n; i++) { cin >> arr[i]; } sort(arr, arr+n); for(int i=0; i<n; i++) { int p = lower_bound(arr, arr+n, arr[i]-d)-arr; ans *= i-p+1; ans %= mod; } cout << ans; return 0; }
#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...