Submission #304518

#TimeUsernameProblemLanguageResultExecution timeMemory
304518SorahISACarnival Tickets (IOI20_tickets)C++17
Compilation error
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; template<typename T> using Prior = priority_queue<T>; template<typename T> using prior = priority_queue<T, vector<T>, greater<T>>; #define X first #define Y second #define ALL(x) (x).begin(), (x).end() #define eb emplace_back #define pb push_back int64_t find_maximum(int k, vector<vector<int>> v) { int n = v.size(), m = v[0].size(); int64_t sum = 0; vector<vector<int>> ans(n, vector<int>(m, -1)); vector<int> cnt; for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { ans[i][j] = j; cnt.eb(v[i][j]); } } sort(ALL(cnt)); for (auto x : cnt) sum += abs(x - cnt[n/2]); allocate_tickets(ans); return sum; }

Compilation message (stderr)

tickets.cpp:17:9: error: ambiguating new declaration of 'int64_t find_maximum(int, std::vector<std::vector<int> >)'
   17 | int64_t find_maximum(int k, vector<vector<int>> v) {
      |         ^~~~~~~~~~~~
In file included from tickets.cpp:1:
tickets.h:3:11: note: old declaration 'long long int find_maximum(int, std::vector<std::vector<int> >)'
    3 | long long find_maximum(int k, std::vector<std::vector<int>> d);
      |           ^~~~~~~~~~~~