Submission #621466

#TimeUsernameProblemLanguageResultExecution timeMemory
621466John3_141592Carnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> #define int long long #define par pair<int,int> #define f first #define s second #define ld long duble #define ull unsigned long long #define st short int using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); vector <int> vec; vector <vector<int>> answer; for(int i=0;i<n;i++){ vector <int> aux; for(int j=0;j<m;j++){ aux.push_back(0); vec.push_back(x[i][j]); } answer.push_back(aux); } sort(vec.begin(),vec.end()); int solve=0; for(int i=0;i<n;i++){ if(i<n/2) solve-=vec[i]; else solve+=vec[i]; } allocate_tickets(answer); return solve; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(long long int, std::vector<std::vector<long long int> >)':
tickets.cpp:32:19: error: could not convert 'answer' from 'vector<vector<long long int>>' to 'vector<vector<int>>'
   32 |  allocate_tickets(answer);
      |                   ^~~~~~
      |                   |
      |                   vector<vector<long long int>>