# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148963 | 2019-09-01T05:28:24 Z | bitKOIn(#3612, gs15120, phsongys) | King of Chairs (FXCUP4_chairs) | C++17 | Compilation error |
0 ms | 0 KB |
#include "king.h" long long SendInfo(std::vector<int> W, std::vector<int> C) { int N = W.size(); return 0; }
#include "vassal.h" #include <bits/stdc++.h> #define PI 3.1415926535897932384626 using namespace std; struct vec { long double x,y; bool operator ==(const vec &a) const{ return x==a.x&&y==a.y; } bool operator <(const vec &a) const{ if(a.x!=x) return x<a.x; return y<a.y; } vec operator +(const vec &a) const{ return {x+a.x,y+a.y}; } vec operator *(const long double &a) const{ return {x*a,y*a}; } vec operator -(const vec &a) const{ return {x-a.x,y-a.y}; } vec operator /(const long double &a) const{ return {x/a,y/a}; } long double len() const{ return sqrt(x*x+y*y); } long double dot(const vec &a) const{ return x*a.x+y*a.y; } long double crs(const vec &a) const{ return x*a.y-y*a.x; } vec proj(const vec &a) const{ return (a/a.len())*(*this).dot(a)/a.len(); } }; struct P { int x,y,z; bool operator <(const P &a) const{ if(x!=a.x) return x<a.x; return y<a.y; } }; long long x,y,z,mod=1000000007; vector<int> v1; int i,n,m,k,a,d,b,c,dx[10]={1,0,-1,0},dy[10]={0,1,0,-1}; int e; int o[221]; int l[221]; int par[1]; int j[1]; //stack<int> s; set<int> s; queue<int> q,q1; P u[211111]; char r[1]; //string r,r1; //2147483647 //'1'==49; //'A'==65; //'a'==97; //unordered_ map<int,int> p; //v.resize(unique(v.begin(),v.end())-v.begin()); //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //rng(); long long BB; void Init(long long B, std::vector<int> C){ int N = C.size(); for(int t=0;t<N;t++) s.insert({C[t],t}); BB = B; // ToDo } set<P> s; int Maid(int W){ //if(W == BB%10) return 2; //if(W == BB/100) return 0; //return -1; set<P>::iterator a=s.lower_bound({W,0}); if(a==s.end()) return -1; int n=(*a).y; s.erase(a); return n; }
Compilation message
king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)': king.cpp:4:6: warning: unused variable 'N' [-Wunused-variable] int N = W.size(); ^ vassal.cpp:90:8: error: conflicting declaration 'std::set<P> s' set<P> s; ^ vassal.cpp:64:10: note: previous declaration as 'std::set<int> s' set<int> s; ^ vassal.cpp: In function 'int Maid(int)': vassal.cpp:96:40: error: no matching function for call to 'std::set<int>::lower_bound(<brace-enclosed initializer list>)' set<P>::iterator a=s.lower_bound({W,0}); ^ In file included from /usr/include/c++/7/set:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87, from vassal.cpp:2: /usr/include/c++/7/bits/stl_set.h:800:7: note: candidate: std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::lower_bound(const key_type&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<int>; std::set<_Key, _Compare, _Alloc>::key_type = int] lower_bound(const key_type& __x) ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_set.h:800:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type& {aka const int&}' /usr/include/c++/7/bits/stl_set.h:804:7: note: candidate: std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::lower_bound(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<int>; std::set<_Key, _Compare, _Alloc>::key_type = int] lower_bound(const key_type& __x) const ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_set.h:804:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const key_type& {aka const int&}' /usr/include/c++/7/bits/stl_set.h:810:2: note: candidate: template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::iterator)(((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::lower_bound(const _Kt&) [with _Kt = _Kt; _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>] lower_bound(const _Kt& __x) ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_set.h:810:2: note: template argument deduction/substitution failed: vassal.cpp:96:40: note: couldn't deduce template parameter '_Kt' set<P>::iterator a=s.lower_bound({W,0}); ^ In file included from /usr/include/c++/7/set:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:87, from vassal.cpp:2: /usr/include/c++/7/bits/stl_set.h:816:2: note: candidate: template<class _Kt> decltype ((std::set<_Key, _Compare, _Alloc>::const_iterator)(((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_lower_bound_tr(__x))) std::set<_Key, _Compare, _Alloc>::lower_bound(const _Kt&) const [with _Kt = _Kt; _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>] lower_bound(const _Kt& __x) const ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_set.h:816:2: note: template argument deduction/substitution failed: vassal.cpp:96:40: note: couldn't deduce template parameter '_Kt' set<P>::iterator a=s.lower_bound({W,0}); ^ vassal.cpp:97:6: error: no match for 'operator==' (operand types are 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' and 'std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}') if(a==s.end()) return -1; ~^~~~~~~~~ In file included from /usr/include/c++/7/map:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81, from vassal.cpp:2: /usr/include/c++/7/bits/stl_tree.h:394:7: note: candidate: bool std::_Rb_tree_const_iterator<_Tp>::operator==(const _Self&) const [with _Tp = P; std::_Rb_tree_const_iterator<_Tp>::_Self = std::_Rb_tree_const_iterator<P>] operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT ^~~~~~~~ /usr/include/c++/7/bits/stl_tree.h:394:7: note: no known conversion for argument 1 from 'std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}' to 'const _Self& {aka const std::_Rb_tree_const_iterator<P>&}' In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:940:5: note: candidate: template<class _BiIter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&) operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) ^~~~~~~~ /usr/include/c++/7/bits/regex.h:940:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1013:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&) operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1013:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1093:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1093:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1173:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&) operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1173:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1247:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1247:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1321:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&) operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1321:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<int>::iterator {aka std::_Rb_tree_const_iterator<int>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1401:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator==(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&) operator==(const sub_match<_Bi_iter>& __lhs, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1401:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/regex:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110, from vassal.cpp:2: /usr/include/c++/7/bits/regex.h:1920:5: note: candidate: template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const std::__cxx11::match_results<_BiIter, _Alloc>&, const std::__cxx11::match_results<_BiIter, _Alloc>&) operator==(const match_results<_Bi_iter, _Alloc>& __m1, ^~~~~~~~ /usr/include/c++/7/bits/regex.h:1920:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:64:0, from /usr/include/c++/7/vector:60, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_pair.h:443:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&) operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ^~~~~~~~ /usr/include/c++/7/bits/stl_pair.h:443:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::pair<_T1, _T2>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/vector:60, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:299:5: note: candidate: template<class _Iterator> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&) operator==(const reverse_iterator<_Iterator>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:299:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::reverse_iterator<_Iterator>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/vector:60, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:337:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator==(const reverse_iterator<_IteratorL>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:337:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::reverse_iterator<_Iterator>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/vector:60, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:1118:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&) operator==(const move_iterator<_IteratorL>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:1118:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::move_iterator<_IteratorL>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0, from /usr/include/c++/7/vector:60, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_iterator.h:1124:5: note: candidate: template<class _Iterator> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&) operator==(const move_iterator<_Iterator>& __x, ^~~~~~~~ /usr/include/c++/7/bits/stl_iterator.h:1124:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::move_iterator<_IteratorL>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/vector:61:0, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/allocator.h:146:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::allocator<_Tp1>&, const std::allocator<_T2>&) operator==(const allocator<_T1>&, const allocator<_T2>&) ^~~~~~~~ /usr/include/c++/7/bits/allocator.h:146:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::allocator<_Tp1>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/vector:61:0, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/allocator.h:152:5: note: candidate: template<class _Tp> bool std::operator==(const std::allocator<_Tp1>&, const std::allocator<_Tp1>&) operator==(const allocator<_Tp>&, const allocator<_Tp>&) ^~~~~~~~ /usr/include/c++/7/bits/allocator.h:152:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::allocator<_Tp1>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/vector:64:0, from vassal.h:2, from vassal.cpp:1: /usr/include/c++/7/bits/stl_vector.h:1596:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator==(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&) operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:1596:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::vector<_Tp, _Alloc>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/iosfwd:40:0, from /usr/include/c++/7/ios:38, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from vassal.cpp:2: /usr/include/c++/7/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&) operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) ^~~~~~~~ /usr/include/c++/7/bits/postypes.h:216:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::set<P>::iterator {aka std::_Rb_tree_const_iterator<P>}' is not derived from 'const std::fpos<_StateT>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/basic_string.h:48:0, from /usr/include/c++/7/string:52, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from vassal.cpp:2: /usr/include/c++/7/string_view:450:5: note: candidate: template<class _CharT, class _Traits> constexpr bool std::operator==(std::basic_string_view<_CharT, _Traits>, std::basic_string_view<_CharT, _Traits>) operator==(basic_string_view<_CharT, _Traits> __x, ^~~~~~~~ /usr/include/c++/7/string_view:450:5: note: template argument deduction/substitution failed: vassal.cpp:97:14: note: 'std::_Rb_tree_const_iterator<P>' is not derived from 'std::basic_string_view<_CharT, _Traits>' if(a==s.end()) return -1; ^ In file included from /usr/include/c++/7/bits/basic_string.h:48:0, from /usr/include/c++/7/string:52, from /usr/include/c++/7/bits/locale_classes.h:40,