Submission #719671

#TimeUsernameProblemLanguageResultExecution timeMemory
719671TAhmed33A Huge Tower (CEOI10_tower)C++98
100 / 100
308 ms10572 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 1e9 + 9; int arr[10000000]; signed main () { int n, d; cin >> n >> d; for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr, arr + n); int l = 1; for (int i = 0; i < n; i++) { int ub = lower_bound(arr, arr + n, arr[i] - d) - arr; l = (l * (i - ub + 1)) % MOD; } cout << l << '\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...