제출 #519087

#제출 시각아이디문제언어결과실행 시간메모리
519087faefeyfaA Huge Tower (CEOI10_tower)C++14
0 / 100
259 ms20804 KiB
#include <bits/stdc++.h> #define MOD 1000000009ll using namespace std; using ll = long long; int main() { int num, tol; cin >> num >> tol; ll* blocks = new ll[num]; for(int ii = 0; ii < num; ii++) cin >> blocks[ii]; sort(blocks,blocks+num,greater<>()); int l; l = 0; ll* addable = new ll[num]; for(int r = 0; r < num; r++) { while(blocks[l]+tol < blocks[r]) l++; addable[r] = l; } ll* ans = new ll[num]; ans[0] = 1; for(int ii = 1; ii < num; ii++) { ans[ii] = ans[ii-1]*addable[ii]; } cout << ans[num-1] << '\n'; 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...