# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
476412 | Iwanttobreakfree | Xylophone (JOI18_xylophone) | C++98 | 0 ms | 200 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"
static int A[5000];
void solve(int N) {
int maxi=0,sol,ans;
for(int i=2;i<=N;i++){
int val=query(1,i);
if(val>maxi){
maxi=val;
sol=i;
}
}
maxi=0;
for(int i=sol+1;i<=N;i++){
int val=query(sol,i);
if(val>maxi){
maxi=val;
ans=i;
}
}
for(int i=sol-1;i>=1;i--){
int val=query(i,sol);
if(val>maxi){
maxi=val;
ans=i;
}
}
answer(sol,ans);
}
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... |