제출 #301021

#제출 시각아이디문제언어결과실행 시간메모리
301021IgorI카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(), m = x[0].size(); vector<int> fr(n), to(n, m - 1); vector<vector<int> > ans(n, vector<int>(m, -1)); long long res = 0; for (int e = 0; e < k; e++) { long long cur = 0; vector<pair<long long, int> > upd; for (int i = 0; i < n; i++) { cur -= x[i][fr[i]]; upd.push_back({x[i][fr[i]] + x[i][to[i]], i}); } sort(upd.begin(), upd.end()); reverse(upd.begin(), upd.end()); for (int i = 0; i < n / 2; i++) { cur += upd[i].first; int id = upd[i].second; ans[id][to[id]] = e; to[id]--; } for (int i = n / 2; i < n; i++) { int id = upd[i].second; ans[id][fr[id]] = e; fr[id]++; } res += cur; } allocate_tickets(ans); return res; }

컴파일 시 표준 에러 (stderr) 메시지

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:37:5: error: 'allocate_tickets' was not declared in this scope
   37 |     allocate_tickets(ans);
      |     ^~~~~~~~~~~~~~~~