제출 #955059

#제출 시각아이디문제언어결과실행 시간메모리
955059Trisanu_Das카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; const int N=1505; int n, m, d[N], s[N]; long long sum; vector<pair<int, int> > v, l; long long find_maximum(int k, vector<vector<int> > x){ n = x.size(); m = x[0].size(); vector<vector<int> > ans(n, vec(m, -1)); for(int i = 0; i < n; i++){ for(int j = 0; j < k; j++) { sum += x[i][m - 1 - j]; v.push_back(make_pair(x[i][j] + x[i][m - k + j], i)); } } sort(v.begin(), v.end()); for(int i = 0; i < n * k / 2; i++) { sum -= v[i].first; d[v[i].second]++; } for(int i = 0; i < n; i++){ l.clear(); for(int j = 0; j < k; j++) l.push_back(make_pair(s[j], j)); sort(l.begin(), l.end()); for(int j = 0; j < k; j++){ if(j < d[i]) { ans[i][j] = l[j].second; s[l[j].second]++; } else ans[i][m - k + j] = l[j].second; } } allocate_tickets(ans); return sum; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:11:30: error: 'vec' was not declared in this scope
   11 |  vector<vector<int> > ans(n, vec(m, -1));
      |                              ^~~