제출 #848217

#제출 시각아이디문제언어결과실행 시간메모리
848217stefanneaguA Huge Tower (CEOI10_tower)C++17
15 / 100
1 ms604 KiB
#include <bits/stdc++.h> #define RolandPetrean ios_base::sync_with_stdio(false); #define will_win cin.tie(); #define ejoi cout.tie(); using namespace std; const int nmax = 70, mod = 1e9 + 9; int v[nmax]; int32_t main() { RolandPetrean will_win ejoi; 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] - d > v[i]) { 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...