# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1032524 | vjudge1 | Xylophone (JOI18_xylophone) | C++17 | 61 ms | 20908 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;
static int A[5000];
int sv[5010][5010];
int myqry(int l,int r){
if(l==r)return 0;
if(sv[l][r])return sv[l][r];
return sv[l][r]=query(l,r);
}
int ans[5010];
int makesense(int a,int b,int c,int ac){
return ac==max({a,b,c})-min({a,b,c});
}
void solve(int N) {
int l=1,r=N-1,res=0;
while(l<=r){
int mid=l+r>>1;
if(myqry(mid,N)==N-1)
res=mid,l=mid+1;
else r=mid-1;
}
int posof1=res;
ans[posof1]=1;
if(posof1>1)
ans[posof1-1]=myqry(posof1-1,posof1)+1;
ans[posof1+1]=myqry(posof1,posof1+1)+1;
for(int i=posof1-2;i>0;i--){
int k=myqry(i,i+1);
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... |