제출 #384348

#제출 시각아이디문제언어결과실행 시간메모리
384348REALITYNB카니발 티켓 (IOI20_tickets)C++14
컴파일 에러
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> #define pb push_back #define all(a) a.begin(),a.end() #define int long long using namespace std; long long find_maximum(int k, vector<vector<int>> a) { int n = a.size(); int m = a[0].size(); vector<vector<int>> answer(n,vector<int>(m,-1)); int res =0 ; if(m==1){ vector<int> b ; for(auto x : a) for(int y : x) b.pb(y) ; sort(all(b)) ; int median = b[n/2]; for(int&x:b) res+=abs(x-median) ; for(int i=0;i<n;i++) answer[i][0]=0; } allocate_tickets(answer); return res; }

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

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