QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#466520 | #5029. 在路上 | lbrlbr | Compile Error | / | / | C++14 | 596b | 2024-07-07 21:39:31 | 2024-07-07 21:39:32 |
Judging History
This is the latest submission verdict.
- [2024-07-07 21:39:32]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-07-07 21:39:31]
- Submitted
answer
#include"path.h"
#include<bits/stdc++.h>
int ask(int x,int y,int z);
int centroid(int id,int N,int M);
int jh[5];
int st[N];
bool cmp(int a,int b){
int x=ask(a,b,st[1]);
return x==a;
}
int centroid(int id,int N,int M){
if(N==3)return ask(1,2,3);
int cnt=0;
for(int i=1;i<=n;++i){
jh[++cnt]=i;
int jb;
if(cnt==3){
jb=ask(jh[1],jh[2],jh[3]);
for(int i=1;i<=3;++i){
if(jh[i]==jb){
swap(jh[i],jh[3]);
continue;
}
}
--cnt;
}
st[i]=i;
}
swap(st[1],st[jh[1]]);
nth_element(st+2,st+2+n/2,st+2+n-1,cmp);
return st[n/2+1];
}
详细
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:7:8: error: ‘N’ was not declared in this scope 7 | int st[N]; | ^ answer.code: In function ‘bool cmp(int, int)’: answer.code:9:23: error: ‘st’ was not declared in this scope; did you mean ‘std’? 9 | int x=ask(a,b,st[1]); | ^~ | std answer.code: In function ‘int centroid(int, int, int)’: answer.code:15:24: error: ‘n’ was not declared in this scope 15 | for(int i=1;i<=n;++i){ | ^ answer.code:22:41: error: ‘swap’ was not declared in this scope 22 | swap(jh[i],jh[3]); | ^~~~ answer.code:22:41: note: suggested alternatives: In file included from /usr/include/c++/13/regex:68, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:181, from answer.code:2: /usr/include/c++/13/bits/regex.h:2230:5: note: ‘std::__cxx11::swap’ 2230 | swap(match_results<_Bi_iter, _Alloc>& __lhs, | ^~~~ In file included from /usr/include/c++/13/bits/stl_pair.h:61, from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51: /usr/include/c++/13/bits/move.h:189:5: note: ‘std::swap’ 189 | swap(_Tp& __a, _Tp& __b) | ^~~~ In file included from /usr/include/c++/13/exception:164, from /usr/include/c++/13/stdexcept:38, from /usr/include/c++/13/system_error:43, from /usr/include/c++/13/bits/ios_base.h:46, from /usr/include/c++/13/streambuf:43, from /usr/include/c++/13/bits/streambuf_iterator.h:35, from /usr/include/c++/13/iterator:66, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54: /usr/include/c++/13/bits/exception_ptr.h:230:5: note: ‘std::__exception_ptr::swap’ 230 | swap(exception_ptr& __lhs, exception_ptr& __rhs) | ^~~~ answer.code:28:17: error: ‘st’ was not declared in this scope; did you mean ‘std’? 28 | st[i]=i; | ^~ | std answer.code:30:14: error: ‘st’ was not declared in this scope; did you mean ‘std’? 30 | swap(st[1],st[jh[1]]); | ^~ | std answer.code:30:9: error: ‘swap’ was not declared in this scope 30 | swap(st[1],st[jh[1]]); | ^~~~ answer.code:30:9: note: suggested alternatives: /usr/include/c++/13/bits/regex.h:2230:5: note: ‘std::__cxx11::swap’ 2230 | swap(match_results<_Bi_iter, _Alloc>& __lhs, | ^~~~ /usr/include/c++/13/bits/move.h:189:5: note: ‘std::swap’ 189 | swap(_Tp& __a, _Tp& __b) | ^~~~ /usr/include/c++/13/bits/exception_ptr.h:230:5: note: ‘std::__exception_ptr::swap’ 230 | swap(exception_ptr& __lhs, exception_ptr& __rhs) | ^~~~ answer.code:31:31: error: ‘n’ was not declared in this scope 31 | nth_element(st+2,st+2+n/2,st+2+n-1,cmp); | ^ answer.code:31:9: error: ‘nth_element’ was not declared in this scope; did you mean ‘std::nth_element’? 31 | nth_element(st+2,st+2+n/2,st+2+n-1,cmp); | ^~~~~~~~~~~ | std::nth_element In file included from /usr/include/c++/13/algorithm:61: /usr/include/c++/13/bits/stl_algo.h:4813:5: note: ‘std::nth_element’ declared here 4813 | nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, | ^~~~~~~~~~~