QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#535786#6345. Random Interactive Convex Hull BotTx_LcyCompile Error//C++141.1kb2024-08-28 14:46:332024-08-28 14:46:33

Judging History

你现在查看的是最新测评结果

  • [2024-08-28 14:46:33]
  • 评测
  • [2024-08-28 14:46:33]
  • 提交

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 id[N],s[N];
inline int query(int A,int B,int C){
    cout<<"? "<<A<<' '<<B<<' '<<C<<endl;
    int x;cin>>x;
    return x;
}
vector<int> convex(int 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);
    }
    vector<int>ans;
    for (auto i:V) ans.push_back(i);
    return ans;
}

詳細信息

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status