Submission #1132073

#TimeUsernameProblemLanguageResultExecution timeMemory
1132073StefanSebezCarnival Tickets (IOI20_tickets)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; #define fi first #define se second #define pb push_back #define ll long long #define ld long double int n,m; long long find_maximum(int k, std::vector<std::vector<int>> d){ n=d.size(),m=d[0].size(); vector<vector<int>>s; for(int i=0;i<n;i++) s.pb(0); allocate_tickets(s); }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:13:30: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(int)'
   13 |     for(int i=0;i<n;i++) s.pb(0);
      |                          ~~~~^~~
In file included from /usr/include/c++/11/vector:67,
                 from /usr/include/c++/11/functional:62,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from tickets.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::value_type = std::vector<int>]'
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from 'int' to 'const value_type&' {aka 'const std::vector<int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::value_type = std::vector<int>]'
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
tickets.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^