QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#535525#6345. Random Interactive Convex Hull BotWorld_CreaterCompile Error//C++141.0kb2024-08-28 09:16:242024-08-28 09:16:25

Judging History

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

  • [2024-08-28 09:16:25]
  • 评测
  • [2024-08-28 09:16:24]
  • 提交

answer

#include "convex.h"
#include<bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
int n,p[5001],tmp[5001];

int query(int a,int b,int c)
{
    cout<<"? "<<a<<" "<<b<<" "<<c<<endl;
    int t;
    cin>>t;
    return t;
}

void solve(int l,int r){
if (l>=r) return;
int x=rnd()%(r-l+1)+l,top=l-1,tt=r+1;
for (int i=l;i<=r;++i) tmp[i]=p[i];
for (int i=l;i<=r;++i) if (i!=x && query(1,tmp[x],tmp[i])==-1) p[++top]=tmp[i];
else if (i!=x) p[--tt]=tmp[i];
p[++top]=tmp[x];
solve(l,top-1),solve(top+1,r);
}

int main()
{
cin>>n;
for (int i=1;i<n;++i) p[i]=i+1;
solve(1,n-1);
int top=0;
for (int i=1;i<n;++i){
while (top>1 && query(tmp[top-1],tmp[top],p[i])==-1) --top;
tmp[++top]=p[i];
}
tmp[++top]=1;
int lt=1;
while (lt+2<top){
if (query(tmp[top-1],tmp[top],tmp[lt])==-1) --top;
else if (query(tmp[top],tmp[lt],tmp[lt+1])==-1) ++lt;
else break;
}
vector<int> ans;
cout<<"! ";
for (int i=lt;i<=top;++i) cout<<tmp[i]<<" ";
cout<<endl;
//return ans;
}

//int main(){
//return 0;
//}

详细

answer.code:1:10: fatal error: convex.h: No such file or directory
    1 | #include "convex.h"
      |          ^~~~~~~~~~
compilation terminated.