제출 #734124

#제출 시각아이디문제언어결과실행 시간메모리
734124studyA Huge Tower (CEOI10_tower)C++17
100 / 100
120 ms10624 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6, mod = 1e9+9; int a[N]; int32_t main(){ ios::sync_with_stdio(0); cin.tie(0); int n,d; cin >> n >> d; for (int i=0; i<n; ++i){ cin >> a[i]; } sort(a,a+n); int fin = 0, ans = 1; for (int i=0; i<n; ++i){ while (fin < n and a[fin] <= d+a[i]){ fin++; } int res = fin-i; ans = (ans*res)%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...