# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
384236 | wind_reaper | 구경하기 (JOI13_watching) | C++17 | 263 ms | 16108 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MXN = 2001;
int dp[MXN][MXN], a[MXN];
int n, p, q;
bool check(int w){
memset(dp, 0, sizeof dp);
for(int i = 1; i <= n; i++){
int l = 1, r = 1;
while(a[i] - a[l] >= w) l++;
while(a[i] - a[r] >= 2*w) r++;
for(int j = 0; j <= p; j++)
if(j == 0) dp[i][j] = dp[r-1][j] + 1;
else dp[i][j] = min(dp[l-1][j-1], dp[r-1][j] + 1);
}
return dp[n][p] <= q;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |