제출 #305382

#제출 시각아이디문제언어결과실행 시간메모리
305382JooDdae카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include "tickets.h" #include<bits/stdc++.h> using namespace std; using ll = long long; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<int> v; for(int i=0;i<n;i++) v.push_back(x[i][0]); sort(v.begin(), v.end()); allocate_tickets(v); ll ans = 0; for(int i=0;i<n/2;i++) ans -= v[i]; for(int i=n/2;i<n;i++) ans += v[i]; return ans; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:13:22: error: could not convert 'v' from 'vector<int>' to 'vector<std::vector<int>>'
   13 |     allocate_tickets(v);
      |                      ^
      |                      |
      |                      vector<int>
tickets.cpp:8:9: warning: unused variable 'm' [-Wunused-variable]
    8 |     int m = x[0].size();
      |         ^