Submission #914401

#TimeUsernameProblemLanguageResultExecution timeMemory
914401ezGeometryA Huge Tower (CEOI10_tower)C++17
100 / 100
221 ms11344 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int MOD = 1e9 + 9; int main() { long long n, d; cin >> n >> d; vector<long long> arr(n); for (int i = 0; i < n; i++) { cin >> arr[i]; } sort(arr.begin(), arr.end()); // sort the blocks int r = 0; long long sol = 1; for (int i = 0; i < n; i++) { while (r + 1 < n && arr[r + 1] <= d + arr[i]) { r++; } sol *= ((long long)r - i + 1); sol %= MOD; } cout << sol << 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...