제출 #564900

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5649002022-05-19 23:20:24SSRS구경하기 (JOI13_watching)C++14
100 / 100
748 ms16068 KiB
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000;
int main(){
int N, P, Q;
cin >> N >> P >> Q;
P = min(P, N);
Q = min(Q, N);
vector<int> A(N);
for (int i = 0; i < N; i++){
cin >> A[i];
}
sort(A.begin(), A.end());
int tv = 500000000, fv = 0;
vector<vector<int>> dp(N + 1, vector<int>(P + 1, INF));
while (tv - fv > 1){
int mid = (tv + fv) / 2;
vector<int> R1(N), R2(N);
for (int i = 0; i < N; i++){
R1[i] = lower_bound(A.begin(), A.end(), A[i] + mid) - A.begin();
R2[i] = lower_bound(A.begin(), A.end(), A[i] + mid * 2) - A.begin();
}
for (int i = 0; i <= N; i++){
for (int j = 0; j <= P; j++){
dp[i][j] = INF;
}
}
dp[0][0] = 0;
for (int i = 0; i < N; i++){
for (int j = 0; j <= min(P, i); j++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...