# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704220 | socpite | Xylophone (JOI18_xylophone) | C++14 | 168 ms | 456 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 "xylophone.h"
#include<bits/stdc++.h>
using namespace std;
const int maxn = 5e3+5;
int n;
int A[maxn];
int d[2][maxn];
int gt(int l, int r){
int mn = n, mx = 1;
for(int i = l; i <= r; i++){
mn = min(mn, A[i]);
mx = max(mx, A[i]);
}
return mx - mn;
}
void solve(int N){
n = N;
for(int i = 2; i <= n; i++){
d[0][i] = query(i-1, i);
}
for(int i = 3; i <= n; i++){
d[1][i] = query(i-2, i);
}
for(A[1] = 1; A[1] <= n; A[1]++){
if(A[1] + d[0][2] > n)continue;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |