Submission #1103108

#TimeUsernameProblemLanguageResultExecution timeMemory
1103108zephyrionA Huge Tower (CEOI10_tower)C++17
30 / 100
85 ms6780 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 9; const int max_n = 1e7; int n, d, arr[max_n], res = 1; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> d; for (int i = 0; i < n; i++) { cin >> arr[i]; } int res = 1; sort(arr, arr + n); 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...