QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#799020 | #63. Meetings | SimonLJK | Compile Error | / | / | C++14 | 1020b | 2024-12-04 20:35:17 | 2024-12-04 20:35:17 |
Judging History
answer
#include "meetings.h"
#include<bits/stdc++.h>
using namespace std;
mt19937 rd(14685413);
vector<int> b[2009];
void solve(int rt,vector<int> vec){
b[rt].clear();
if(!vec.size()) return;
if(vec.size()==1){ Bridge(rt,vec[0]); return; }
random(vec.begin(),vec.end());
int nd=vec.back(); vec.pop_back();
vector<int> sta;
int v,w;
for(int i=0;i<vec.size();i++){
v=vec[i]; w=Query(rt,nd,v);
if(w==v){ sta.push_back(v); }
else{ b[w].push_back(v); }
}
int l,r,mid,re;
for(int i=1;i<sta.size();i++){
l=0,r=i-1,re=i;
while(l<=r){
mid=(l+r)/2;
if(Query(rt,sta[mid],sta[i])==sta[i]) re=mid,l=mid-1;
else r=mid+1;
}
for(int j=i;j>re;j--)
swap(sta[j],sta[j-1]);
}
for(int i=1;i<sta.size();i++)
Bridge(sta[i-1],sta[i]);
Bridge(rt,sta[0]); Bridge(sta.back(),nd);
for(int i=0;i<sta.size();i++)
Solve(sta[i],b[sta[i]]);
return;
}
void solve(int N){
int rt=rd()%N;
for(int i=0;i<N;i++)
if(i!=rt)
b[rt].push_back(i);
solve(rt,b[rt]);
return;
}
Details
answer.code: In function ‘void solve(int, std::vector<int>)’: answer.code:10:15: error: too many arguments to function ‘long int random()’ 10 | random(vec.begin(),vec.end()); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:42, from answer.code:2: /usr/include/stdlib.h:401:17: note: declared here 401 | extern long int random (void) __THROW; | ^~~~~~ answer.code:34:22: error: too many arguments to function ‘void Solve(int)’ 34 | Solve(sta[i],b[sta[i]]); | ~~~~~^~~~~~~~~~~~~~~~~~ In file included from answer.code:1: meetings.h:1:6: note: declared here 1 | void Solve(int N); | ^~~~~