QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#68156 | #5029. 在路上 | xlwang | Compile Error | / | / | C++14 | 1.0kb | 2022-12-14 20:22:17 | 2022-12-14 20:22:17 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-12-14 20:22:17]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-12-14 20:22:17]
- 提交
answer
#include<bits/stdc++.h>
#include"path.h"
#define fr(i,j,k) for(register int i=j;i<=k;++i)
#define randfind(l,r) ((rnd()%(r-l+1))+l)
const int Maxn=5e4+10;
int num[5];
int vis[Maxn];
mt19937_64 rnd(114514);
int n;
int pop[Maxn];
inline int solve(int k,int id){
if(k==1) {
fr(i,1,n) if(vis[i]) return i;
}
int now1,now2;
now1=randfind(1,1);now2=randfind(now1+1,k);
int cnt=0;
fr(i,1,n){
cnt+=vis[i];
if(cnt==now1){
now1=i;
break;
}
}
if(id==1) return now1;
cnt=0;
fr(i,1,n){
cnt+=vis[i];
if(cnt==now2){
now2=i;
break;
}
}
memset(num,0,sizeof(num));
fr(i,1,n){
if(vis[i]==0) continue;
int tot;
tot=ask(now1,now2,i);
pop[i]=tot;
if(tot==now1) ++num[1];
if(tot==i) ++num[2];
if(tot=now2) ++num[3];
}
if(k==1) return now1;k-=1;
if(k<=num[1]){
memset(vis,0,sizeof(vis));
fr(i,1,n){
if(vis[i]==0) continue;
if(pop[i]) ==
}
}
}
inline int centroid(int id,int N,int M){
fr(i,1,N) vis[i]=1;
if(N==3) return ask(1,2,3);
n=N;
return solve(N,(N+1)/2);
}
详细
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:8:1: error: ‘mt19937_64’ does not name a type 8 | mt19937_64 rnd(114514); | ^~~~~~~~~~ answer.code: In function ‘int solve(int, int)’: answer.code:4:25: error: ‘rnd’ was not declared in this scope; did you mean ‘rand’? 4 | #define randfind(l,r) ((rnd()%(r-l+1))+l) | ^~~ answer.code:16:14: note: in expansion of macro ‘randfind’ 16 | now1=randfind(1,1);now2=randfind(now1+1,k); | ^~~~~~~~ answer.code:49:36: error: expected primary-expression before ‘==’ token 49 | if(pop[i]) == | ^~ answer.code:50:17: error: expected primary-expression before ‘}’ token 50 | } | ^