Submission #1289638

#TimeUsernameProblemLanguageResultExecution timeMemory
1289638bilgunCarnival Tickets (IOI20_tickets)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "tickets.h"
using namespace std;

long long find_maximum(int k, vector<vector<int>> vec){
    int n = vec.size(), m = vec[0].size();
    vector<int> ans;
    int count = 0, s = 0;
    for( int i = 0; i < n; i++){
        ans.push_back(vec[i][0]);
        count += vec[i][0];
    }
    count /= n;
    for( int i = 0; i < n; i++){
        s += abs(vec[i][0] - count);
    }
    allocate_tickets(ans);
    return s;
}

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:17:22: error: could not convert 'ans' from 'vector<int>' to 'vector<std::vector<int>>'
   17 |     allocate_tickets(ans);
      |                      ^~~
      |                      |
      |                      vector<int>