# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973297 | 2024-05-01T17:42:31 Z | AliHasanli | Connecting Supertrees (IOI20_supertrees) | C++17 | Compilation error |
0 ms | 0 KB |
#include "supertrees.h" #include <vector> using namespace std; int construct(vector<vector<int>> p) { int b[p.size()][p.size()]; for(int i=0;i<p.size();i++) for(int j=0;j<p[i].size();j++) if(p[i]==3)return 0; else b[i][j]=0; for(int i=0;i<n-2;i++) b[i][i+1]=1,b[i+1][i]=1; build(b); return 1; }
Compilation message
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)': supertrees.cpp:7:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare] 7 | for(int i=0;i<p.size();i++) | ~^~~~~~~~~ supertrees.cpp:8:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 8 | for(int j=0;j<p[i].size();j++) | ~^~~~~~~~~~~~ supertrees.cpp:9:20: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int') 9 | if(p[i]==3)return 0; In file included from /usr/include/c++/10/bits/stl_algobase.h:64, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_pair.h:466:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)' 466 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_pair.h:466:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:360:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)' 360 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:360:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:398:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)' 398 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:398:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1427:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)' 1427 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1427:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1495:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)' 1495 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1495:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/vector:64, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/allocator.h:206:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const std::allocator<_Tp1>&, const std::allocator<_T2>&)' 206 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/10/bits/allocator.h:206:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::allocator<_Tp1>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/vector:67, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_vector.h:1892:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)' 1892 | operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_vector.h:1892:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/vector:64, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/allocator.h:192:7: note: candidate: 'bool std::operator==(const std::allocator<int>&, const std::allocator<int>&)' 192 | operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/10/bits/allocator.h:192:18: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'const std::allocator<int>&' 192 | operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1064:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)' 1064 | operator==(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1064:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/vector:60, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/bits/stl_iterator.h:1072:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)' 1072 | operator==(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1072:5: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 9 | if(p[i]==3)return 0; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/c++allocator.h:33, from /usr/include/c++/10/bits/allocator.h:46, from /usr/include/c++/10/vector:64, from supertrees.h:1, from supertrees.cpp:1: /usr/include/c++/10/ext/new_allocator.h:171:2: note: candidate: 'template<class _Up> bool __gnu_cxx::operator==(const __gnu_cxx::new_allocator<int>&, const __gnu_cxx::new_allocator<_Tp>&)' 171 | operator==(const new_allocator&, const new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/10/ext/new_allocator.h:171:2: note: template argument deduction/substitution failed: supertrees.cpp:9:22: note: mismatched types 'const __gnu_cxx::new_allocator<_Tp>' and 'int' 9 | if(p[i]==3)return 0; | ^ supertrees.cpp:12:19: error: 'n' was not declared in this scope 12 | for(int i=0;i<n-2;i++) | ^ supertrees.cpp:14:11: error: could not convert '(int (*)[(<anonymous> + 1)])(& b)' from 'int (*)[(<anonymous> + 1)]' to 'std::vector<std::vector<int> >' 14 | build(b); | ^ | | | int (*)[(<anonymous> + 1)]