Submission #1103106

#TimeUsernameProblemLanguageResultExecution timeMemory
1103106zephyrionA Huge Tower (CEOI10_tower)C++17
30 / 100
196 ms10672 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 9; signed main() { int n, d; cin >> n >> d; vector<int> arr; for (int i = 0; i < n; i++) { int k; cin >> k; arr.push_back(k); } int res = 1; sort(arr.begin(), arr.end()); for (int l = 0, r = 0; l < n; l++){ for (; r < n && arr[r] - arr[l] <= d; r++){ res *= (r - l + 1) % mod; } } cout << res << endl; 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...