제출 #309430

#제출 시각아이디문제언어결과실행 시간메모리
309430jam_xd_슈퍼트리 잇기 (IOI20_supertrees)C++17
컴파일 에러
0 ms0 KiB
#include "supertrees.h" #include "bits/stdc++.h" using namespace std; int construct (vector<vector<int> >p){ deque<vector<int> >resp; for(int i=0;i<p.size();i++){ deque<int>jaja; for(int j=0;j<p.size();j++){ if(i == 0 and j != 0) jaja.push_back(1); else if(i != 0 and j == 0) jaja.push_back(1); else if(i == 0 and j == 0)jaja.push_back(0); } resp.push_back(jaja); } build(resp); return 1; }

컴파일 시 표준 에러 (stderr) 메시지

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int i=0;i<p.size();i++){
      |                 ~^~~~~~~~~
supertrees.cpp:10:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         for(int j=0;j<p.size();j++){
      |                     ~^~~~~~~~~
supertrees.cpp:15:28: error: no matching function for call to 'std::deque<std::vector<int> >::push_back(std::deque<int>&)'
   15 |         resp.push_back(jaja);
      |                            ^
In file included from /usr/include/c++/9/deque:67,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:68,
                 from supertrees.cpp:2:
/usr/include/c++/9/bits/stl_deque.h:1569:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::deque<_Tp, _Alloc>::value_type = std::vector<int>]'
 1569 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1569:35: note:   no known conversion for argument 1 from 'std::deque<int>' to 'const value_type&' {aka 'const std::vector<int>&'}
 1569 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_deque.h:1584:7: note: candidate: 'void std::deque<_Tp, _Alloc>::push_back(std::deque<_Tp, _Alloc>::value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::deque<_Tp, _Alloc>::value_type = std::vector<int>]'
 1584 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/9/bits/stl_deque.h:1584:30: note:   no known conversion for argument 1 from 'std::deque<int>' to 'std::deque<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1584 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
supertrees.cpp:18:11: error: could not convert 'resp' from 'std::deque<std::vector<int> >' to 'std::vector<std::vector<int> >'
   18 |     build(resp);
      |           ^~~~
      |           |
      |           std::deque<std::vector<int> >