Submission #306463

#TimeUsernameProblemLanguageResultExecution timeMemory
306463giorgikobCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "tickets.h" #include <vector> #include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back 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(n, vector<int>(m,0)); for(int i = 0; i < n; i++) v.pb(x[i][0]); sort(v.begin(),v.end()); ll result = 0; for(int i = 0; i < n; i++) result += abs(v[i]-v[n/2]); allocate_tickets(answer); return result; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:15:32: error: 'v' was not declared in this scope
   15 |     for(int i = 0; i < n; i++) v.pb(x[i][0]);
      |                                ^
tickets.cpp:16:10: error: 'v' was not declared in this scope
   16 |     sort(v.begin(),v.end());
      |          ^