# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
24843 | nibnalin | 구경하기 (JOI13_watching) | C++14 | 333 ms | 17744 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = int(2e3)+5, inf = int(1e9)+5;
int n, p, q, A[maxn], nex[maxn][2], memo[maxn][maxn];
bool f(int w)
{
for(int idx = n-1;idx >= 0;idx--)
{
nex[idx][0] = int(lower_bound(A, A+n, A[idx]+w)-A);
nex[idx][1] = int(lower_bound(A, A+n, A[idx]+min(inf, 2*w))-A);
for(int pp = 0;pp <= p;pp++)
{
memo[idx][pp] = inf;
if(pp) memo[idx][pp] = min(memo[idx][pp], memo[nex[idx][0]][pp-1]);
memo[idx][pp] = min(memo[idx][pp], memo[nex[idx][1]][pp]+1);
}
}
//cout << w << " " << memo[0][p] << "\n";
return (memo[0][p] <= q);
}
int main(void)
{
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |