Submission #300763

#TimeUsernameProblemLanguageResultExecution timeMemory
300763IgorICarnival Tickets (IOI20_tickets)C++17
Compilation error
0 ms0 KiB
#include "tickets.h"
#include <vector>

using namespace std;

long long find_maximum(int k, std::vector<std::vector<int>> x)
{
	int n = x.size(), m = x[0].size();
    vector<long long> s;
    for (int i = 0; i < n; i++) s.push_back(x[i][0]);
    sort(all(s));
    long long si = 0;
    for (int i = 0; i < n / 2; i++) si += s[i + n / 2] - s[i];
    allocate_tickets(vector<vector<int> >(n, vector<int>(m)));
    return si;
}

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:11:10: error: 'all' was not declared in this scope
   11 |     sort(all(s));
      |          ^~~
tickets.cpp:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(all(s));
      |     ^~~~
      |     short