Submission #301035

#TimeUsernameProblemLanguageResultExecution timeMemory
301035NucleistCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> #define sz(x) x.size() #define ve vector<int> #define pb push_back #define all(x) x.begin(),x.end() using namespace std; long long find_maximum(int k,vector<vector<int>> x) { int m=sz(x); ve cur; for (int i = 0; i < m; ++i) { cur.pb(x[i][0]); } sort(all(cur)); int in=x[m/2]; int ans=0; for(auto it:cur){ ans+=abs(it-in); } return ans; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:16:14: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in initialization
   16 |  int in=x[m/2];
      |              ^