제출 #597095

#제출 시각아이디문제언어결과실행 시간메모리
597095MerakulusA Huge Tower (CEOI10_tower)C++17
100 / 100
278 ms8220 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define ll long long int mod = 1e9 + 9; int main(){ int n = 0; int d = 0; ll ans = 1; cin >> n >> d; vector<int> size(n); for(int i = 0; i < n; i++){ cin >> size[i]; } sort(size.begin(), size.end()); int l = 0; for(int i = 0; i < n; i++){ while(l < i && size[i] - size[l] > d){ l += 1; } int iSize = i - l + 1; ans *= iSize; ans %= mod; } cout << ans << endl; 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...