제출 #433641

#제출 시각아이디문제언어결과실행 시간메모리
433641SAAD카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <string.h> #include "tickets.h" using namespace std; long long find_maximum(int k, vector<vector<long long>> x) { vector<vector<int>> x1(x.size()) ; long long sum = 0 , s = 0 ; for (int i = 0; i < x.size(); i++) { sum += x[i][0]; x1[i].push_back(0); } sum /= x.size(); for (int i = 0; i < x.size(); i++) { s += abs(x[i][0]-sum); } allocate_tickets(x1); return s; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<long long int> >)':
tickets.cpp:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int i = 0; i < x.size(); i++) {
      |                     ~~^~~~~~~~~~
tickets.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 0; i < x.size(); i++) {
      |                     ~~^~~~~~~~~~
/usr/bin/ld: /tmp/ccTzoEsC.o: in function `main':
grader.cpp:(.text.startup+0x3b2): undefined reference to `find_maximum(int, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status