QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#481248 | #5029. 在路上 | jager59 | Compile Error | / | / | C++17 | 1.1kb | 2024-07-16 22:07:37 | 2024-07-16 22:07:38 |
Judging History
This is the latest submission verdict.
- [2024-07-16 22:07:38]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-07-16 22:07:37]
- Submitted
answer
#include <bits/stdc++.h>
#include "path.h"
using namespace std;
const int N=3e4+5;
int ask(int x,int y,int z);
int n,u,v,p[N],cu,cv;
vector<int>p1,p2;
inline bool cmp(int a,int b){
return ask(u,a,b)==a;
}
mt19937 orz(114514);
inline int solve(){
return 1;
}
int centroid(int id,int nn,int mm){
n=nn;
if(id==1)return ask(1,2,3);
else if(id==3||id==5){
u=1,v=2;
for(int i = 3;i<=n;i++){
int now = ask(u,i,v);
if(now==u)u=i;
else if(now==v)v=i;
}
int len = 0;
for(int i = 1;i<=n;i++)if(i!=u&&i!=v)p[++len]=i;
sort(p+1,p+(len+1)/2,p+len+1,cmp);
return p[(len+1)/2];
}
while(1){
u=orz()%n+1,v=orz()%n+1;
while(u==v)v=orz()%n+1;
cu=cv=1;
p1.clear(),p2.clear();
for(int i = 1;i<=n;i++){
if(i==u||i==v)continue;
int now = ask(u,i,v);
if(now==i)p1.push_back(i),p2.push_back(i);
else if(now==u)cu++;
else if(now==v)cv++;
else p2.push_back(i);
}
int g=solve();
if(g)return g;
}
}
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: In function ‘int centroid(int, int, int)’: answer.code:27:13: error: no matching function for call to ‘sort(int*, int*, int*, bool (&)(int, int))’ 27 | sort(p+1,p+(len+1)/2,p+len+1,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51, from answer.code:1: /usr/include/c++/13/bits/stl_algo.h:4851:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’ 4851 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/13/bits/stl_algo.h:4851:5: note: template argument deduction/substitution failed: answer.code:27:13: note: candidate expects 2 arguments, 4 provided 27 | sort(p+1,p+(len+1)/2,p+len+1,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:4882:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ 4882 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/13/bits/stl_algo.h:4882:5: note: template argument deduction/substitution failed: answer.code:27:13: note: candidate expects 3 arguments, 4 provided 27 | sort(p+1,p+(len+1)/2,p+len+1,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/algorithm:73: /usr/include/c++/13/pstl/glue_algorithm_defs.h:292:1: note: candidate: ‘template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)’ 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/13/pstl/glue_algorithm_defs.h:292:1: note: template argument deduction/substitution failed: In file included from /usr/include/c++/13/pstl/glue_algorithm_defs.h:15: /usr/include/c++/13/pstl/execution_defs.h: In substitution of ‘template<class _ExecPolicy, class _Tp> using __pstl::__internal::__enable_if_execution_policy = typename std::enable_if<__pstl::execution::v1::is_execution_policy<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type>::value, _Tp>::type [with _ExecPolicy = int*; _Tp = void]’: /usr/include/c++/13/pstl/glue_algorithm_defs.h:292:1: required by substitution of ‘template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _ExecutionPolicy = int*; _RandomAccessIterator = int*; _Compare = bool (*)(int, int)]’ answer.code:27:13: required from here /usr/include/c++/13/pstl/execution_defs.h:150:7: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ 150 | using __enable_if_execution_policy = | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/pstl/glue_algorithm_defs.h:296:1: note: candidate: ‘template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)’ 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/13/pstl/glue_algorithm_defs.h:296:1: note: template argument deduction/substitution failed: answer.code:27:13: note: candidate expects 3 arguments, 4 provided 27 | sort(p+1,p+(len+1)/2,p+len+1,cmp); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~