Submission #383796

#TimeUsernameProblemLanguageResultExecution timeMemory
383796wabadabakalakabooA Huge Tower (CEOI10_tower)C++17
100 / 100
298 ms5228 KiB
#include <bits/stdc++.h> using namespace std; long long n, d, a[1000005], p = 1; int main() { cin >> n >> d; for (int i = 0; i < n; i++) cin >> a[i]; sort(a,a+n); for (int i = 0, j = 0; i < n; i++) { for (; a[i]-d > a[j]; j++); p = (p * (i-j+1)) % 1000000009; } cout << p; }
#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...