# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568190 | gg123_pe | Watching (JOI13_watching) | C++14 | 217 ms | 16204 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
#define f(i,a,b) for(int i = a; i < b; i++)
#define fa(i,a,b) for(int i = a; i >= b; i--)
#define ff first
#define ss second
const int N = 2005;
const ll inf = 1e17 + 100;
int n, p, q, dp[N][N];
int a[N], idw[N], id2w[N];
void go(int w){
queue <pair<int,int>> q1, q2;
f(i,1,n+1){
q1.push({a[i], i}); q2.push({a[i], i});
while(a[i] - q1.front().first > w-1) q1.pop();
idw[i] = q1.front().second;
while(a[i] - q2.front().first > 2*w-1) q2.pop();
id2w[i] = q2.front().second;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |