제출 #459480

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4594802021-08-08 14:27:49astoria카니발 티켓 (IOI20_tickets)C++14
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int N=x.size(), M=x[0].size();
vector<vector<int> > ans(N);
for(int i=0; i<N; i++) ans[i].resize(M);
for(int i=0; i<N; i++)
for(int j=0; j<M; j++)
ans[i][j] = -1;
ll sum=0;
priority_queue<pair<ll,pair<int,int> > > pq; //<value, <colour,ticket> >
for(int i=0; i<N; i++){
for(int j=0; j<k; j++){
sum -= x[i][j];
pq.push({x[i][j]+x[i][M-k+j] , {i,j} });
ans[i][j] = 0; //'-'
}
}
int trades = N*k/2;
for(int ahc=0; ahc<trades; ahc++){
ll v = pq.top().first; int i=pq.top().second.first, j=pq.top().second.second;
pq.pop();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

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