Submission #1142854

#TimeUsernameProblemLanguageResultExecution timeMemory
1142854PagodePaivaCarnival Tickets (IOI20_tickets)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "tickets.h" #include <vector> using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); std::vector<std::vector<int>> answer; vector <int> v; for(int i = 0;i < n;i++){ answer.push_back({0}); v.push_back(x[i][0]); } sort(v.begin(), v.end()); alocate_tickets(answer); int pos = n/2; long long res = 0; for(auto x : v){ res += abs(v[pos]-x); } return res; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:17:9: error: 'alocate_tickets' was not declared in this scope; did you mean 'allocate_tickets'?
   17 |         alocate_tickets(answer);
      |         ^~~~~~~~~~~~~~~
      |         allocate_tickets