제출 #301031

#제출 시각아이디문제언어결과실행 시간메모리
301031Nucleist카니발 티켓 (IOI20_tickets)C++14
컴파일 에러
0 ms0 KiB
#include "tickets.h" #include <bits/stdc++.h> #define size(x) x.size() #define ve vector<int> #define pb push_back using namespace std; long long find_maximum(int k,vector<vector<int>> x) { int m=sz(x); ve cur; for (int i = 0; i < m; ++i) { cur.pb(x[i][0]); } sort(all(cur)); int in=x[m/2]; int ans=0; for(auto it:cur){ ans+=abs(it-in); } return ans; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:8:8: error: 'sz' was not declared in this scope
    8 |  int m=sz(x);
      |        ^~
tickets.cpp:14:7: error: 'all' was not declared in this scope
   14 |  sort(all(cur));
      |       ^~~
tickets.cpp:15:14: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in initialization
   15 |  int in=x[m/2];
      |              ^