QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#535784#6345. Random Interactive Convex Hull BotTx_LcyCompile Error//C++141.0kb2024-08-28 14:45:312024-08-28 14:45:32

Judging History

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

  • [2024-08-28 14:45:32]
  • 评测
  • [2024-08-28 14:45:31]
  • 提交

answer

//A tree without skin will surely die.
//A man without face will be alive.
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#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];
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;
}

Details

answer.code: In function ‘std::vector<int> convex(int)’:
answer.code:13:9: error: ‘query’ was not declared in this scope
   13 |     if (query(1,2,3)==1) V.emplace_back(1),V.emplace_back(2),V.emplace_back(3);
      |         ^~~~~
answer.code:19:17: error: ‘query’ was not declared in this scope
   19 |             if (query(V[0],V[mid],i)==1) l=mid;
      |                 ^~~~~
answer.code:22:29: error: ‘query’ was not declared in this scope
   22 |         if (l<V.size()-1 && query(V[l],V[l+1],i)==1) continue;
      |                             ^~~~~
answer.code:24:16: error: ‘query’ was not declared in this scope
   24 |         while (query(V[0],V[1],i)==-1) V.pop_front();
      |                ^~~~~
answer.code:25:16: error: ‘query’ was not declared in this scope
   25 |         while (query(V[V.size()-2],V[V.size()-1],i)==-1) V.pop_back();
      |                ^~~~~