QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#466475 | #5029. 在路上 | huang123zs | Compile Error | / | / | C++14 | 1.0kb | 2024-07-07 21:09:04 | 2024-07-07 21:09:05 |
Judging History
answer
#include "soul.h"
#include<bits/stdc++.h>
using namespace std;
const int N=3.1e5;
int a[N];
int p[N],tp,q[N],tq;
bool flg[N];
int centroid(int idd,int n,int m){
for(int i=1;i<=n;++i)
flg[i]=0;
srand(time(0));
if(idd==1){
return ask(1,2,3);
}
if(idd==3){
int l=rand()%n+1,r=rand()%n+1;
for(int i=1;i<=n;++i)
a[i]=i;
random_shuffle(a+1,a+n+1);
for(int i=1;i<=n;++i){
if(a[i]==l||a[i]==r) continue;
int x=ask(a[i],l,r);
if(x==l)
l=a[i];
else if(x==r)
r=a[i];
}
random_shuffle(a+1,a+n+1);
for(int i=1,x;i<=n;++i){
x=a[i];
if(flg[x]) continue;
for(int j=1;j<=n;++j){
if(j==x) continue;
if(ask(l,x,j)==j)
p[++tp]=j;
else
q[++tq]=j;
if(tp==tq){
return x;
}
if(tp<tq){
for(int k=1;k<=tp;++k)
flg[p[k]]=1;
tp=tq=0;
}
else{
for(int k=1;k<=tq;++k)
flg[q[k]]=1;
tp=tq=0;
}
}
}
for(int i=1,x;i<=n;++i)
if(!flg[i])
return i;
}
}
Details
implementer.cpp: In function ‘int main()’: implementer.cpp:60:14: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 60 | fread(Interactor::rbuf,1,50000000,stdin); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer.code:1:10: fatal error: soul.h: No such file or directory 1 | #include "soul.h" | ^~~~~~~~ compilation terminated.