# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
817891 | Isam | Watching (JOI13_watching) | C++17 | 278 ms | 8620 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<algorithm>
using namespace std;
int n, p, q;
const int MAX = 2001;
int dp[MAX][MAX];
int x[MAX];
int Find(int pos, int seg){
int xpos = x[pos + 1] + seg - 1;
int l = pos + 1, r = n - 1, mid, last = pos;
while(l <= r){
mid = l + ((r - l) >> 1);
if(x[mid] <= xpos){
last = mid;
l = mid + 1;
}else{
r = mid - 1;
}
}
return last;
}
bool check(int& w){
dp[0][0] = -1;
for(int i = 0; i <= p; ++i){
for(int j = 0; j <= q; ++j){
if(!i && !j) continue;
if(!i) dp[i][j] = Find(dp[i][j-1], (w << 1));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |