제출 #397725

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

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:13:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(i=0;i<v.size();i++)
      |             ~^~~~~~~~~
tickets.cpp:15:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         if(2*i<v.size())ans-=v[i];
      |            ~~~^~~~~~~~~
tickets.cpp:26:5: error: 'allocate_tickets' was not declared in this scope
   26 |     allocate_tickets(res);
      |     ^~~~~~~~~~~~~~~~