Submission #728713

#TimeUsernameProblemLanguageResultExecution timeMemory
728713benjaminguoA Huge Tower (CEOI10_tower)C++14
100 / 100
312 ms8728 KiB
#include <iostream> #include <iomanip> #include <algorithm> #include <string> #include <cmath> #include <map> #include <vector> #include <climits> #include <queue> using namespace std; int ans[26][1500]; int main() { int n; int d; int r = 0; int sol = 1; cin >> n; cin >> d; vector<int> ar(n); for (int i = 0; i < n; i++) { cin >> ar[i]; } sort(ar.begin(), ar.end()); for (int l = 0; l < n; l++) { while (r < n - 1 && ar[r + 1] - ar[l] <= d) { r++; } int dist = r - l + 1; sol = (sol * 1LL * dist) % 1000000009; } cout << sol; 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...