Submission #531277

#TimeUsernameProblemLanguageResultExecution timeMemory
531277sidonA Huge Tower (CEOI10_tower)C++17
100 / 100
114 ms10608 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int M = 1e9+9; int32_t main() { ios::sync_with_stdio(0), cin.tie(0); int N, D, res = 1, j = 0; cin >> N >> D; int a[N]; for(int &i : a) cin >> i; sort(a, a + N); for(int i = 0; i < N; ++i) { while(a[j] + D < a[i]) ++j; (res *= i - j + 1) %= M; } cout << res; }
#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...