QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#535788 | #6345. Random Interactive Convex Hull Bot | Tx_Lcy | WA | 1ms | 3680kb | C++14 | 1.1kb | 2024-08-28 14:47:47 | 2024-08-28 14:47:47 |
Judging History
answer
//A tree without skin will surely die.
//A man without face will be alive.
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=j;i<=k;++i)
#define per(i,j,k) for(int i=j;i>=k;--i)
mt19937_64 rnd(time(0));
int const N=5e3+10;
int n,id[N],s[N];
inline int query(int A,int B,int C){
cout<<"? "<<A<<' '<<B<<' '<<C<<endl;
int x;cin>>x;
return x;
}
signed main(){
cin>>n;
deque<int>V;
if (query(1,2,3)==1) V.emplace_back(1),V.emplace_back(2),V.emplace_back(3);
else V.emplace_back(1),V.emplace_back(3),V.emplace_back(2);
rep(i,4,n){
int l=0,r=V.size()-1;
while (l<r){
int mid=(l+r+1)>>1;
if (query(V[0],V[mid],i)==1) l=mid;
else r=mid-1;
}
if (l<V.size()-1 && query(V[l],V[l+1],i)==1) continue;
rotate(V.begin(),V.begin()+l+1,V.end());
while (query(V[0],V[1],i)==-1) V.pop_front();
while (query(V[V.size()-2],V[V.size()-1],i)==-1) V.pop_back();
V.push_back(i);
}
cout<<"! ";
for (auto i:V) cout<<i<<' ';
cout<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3680kb
input:
5 -1 -1 -1 -1 1 1 1 1 1 1
output:
? 1 2 3 ? 1 3 4 ? 1 3 4 ? 3 2 4 ? 2 1 4 ? 2 1 4 ? 2 1 5 ? 2 4 5 ? 2 1 5 ? 1 4 5 ! 2 1 4 5
result:
wrong answer incorrect hull, 10 queries