제출 #300756

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

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

tickets.cpp: In function 'long long int find_maximim(int, std::vector<std::vector<int> >)':
tickets.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
/tmp/cc9CE5We.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