#include "xylophone.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int x){
int l=3,r=x,mid,bst=2;
while(l<=r){
mid=(l+r)/2;
if(query(1,mid)==x-1)r=mid-1,bst=mid;
else l=mid+1;
}
answer(bst,x);
int lst=x;
for(int i=bst+1;bst<=x;bst++){
lst=query(i-1,i);
answer(i,lst);
}
lst=bst;
for(int i=bst-1;i>=1;i--){
lst=query(i,i+1);
answer(i,lst);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |