Submission #848222

#TimeUsernameProblemLanguageResultExecution timeMemory
848222stefanneaguA Huge Tower (CEOI10_tower)C++17
15 / 100
1 ms604 KiB
#include <bits/stdc++.h> #define Roland_Petrean ios_base::sync_with_stdio(false); #define will_win cin.tie(); #define ejoi_2023 cout.tie(); #define int long long using namespace std; const int nmax = 70, mod = 1e9 + 9; int v[nmax]; int32_t main() { Roland_Petrean will_win ejoi_2023; int n, d; cin >> n >> d; for(int i = 1; i <= n; i ++) { cin >> v[i]; } sort(v + 1, v + n + 1, greater<int>()); int curr = 1; long long ans = 1; for(int i = 1; i <= n; i ++) { if(v[curr] > v[i] + d) { curr ++; } ans = ans * (i - curr + 1); ans %= mod; } cout << ans; 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...