Submission #301031

#TimeUsernameProblemLanguageResultExecution timeMemory
301031NucleistCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> #define size(x) x.size() #define ve vector<int> #define pb push_back 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:8:8: error: 'sz' was not declared in this scope
    8 |  int m=sz(x);
      |        ^~
tickets.cpp:14:7: error: 'all' was not declared in this scope
   14 |  sort(all(cur));
      |       ^~~
tickets.cpp:15: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
   15 |  int in=x[m/2];
      |              ^