Submission #592407

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5924072022-07-09 07:12:39ogibogi2004Carnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "tickets.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
long long find_maximum(ll k, vector<vector<ll>> x) {
//cout<<"?\n";
ll n = x.size();
ll m = x[0].size();
vector<vector<int>> answer;
vector<ll>smallest[n];
for(ll i=0;i<n;i++)
{
smallest[i]=x[i];
sort(smallest[i].begin(),smallest[i].end());
}
ll use[n][m];
memset(use,-1,sizeof(use));
ll dp[n][n*k];
ll hist[n][n*k];
bool c[n][n*k];
memset(c,0,sizeof(c));
ll sum=0;
for(ll j=0;j<k;j++)sum-=smallest[0][j];
dp[0][k]=sum;c[0][k]=1;
hist[0][k]=k;
for(ll j=k-1;j>=0;j--)
{
sum+=smallest[0][j];
sum+=smallest[0][smallest[0].size()-(k-j)];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(long long int, std::vector<std::vector<long long int> >)':
tickets.cpp:118:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  118 |         for(ll i=0;i<sizes.size();i++)
      |                    ~^~~~~~~~~~~~~
tickets.cpp:143:27: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(std::vector<long long int>&)'
  143 |         answer.push_back(v);
      |                           ^
In file included from /usr/include/c++/10/vector:67,
                 from tickets.h:1,
                 from tickets.cpp:1:
/usr/include/c++/10/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++/10/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const value_type&' {aka 'const std::vector<int>&'}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/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++/10/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~