Submission #478484

#TimeUsernameProblemLanguageResultExecution timeMemory
478484khoabrightCarnival Tickets (IOI20_tickets)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int int64_t #define ff first #define ss second #define pii pair<int, int> #define all(x) x.begin(), x.end() #define rep(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define rep1(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define mp make_pair #define vii vector<vector<int>> const int N = 2e5 + 5; void allocate_tickets(vii a); int sub1(vii a) { int n = a.size(); vector<int> v(n); rep(i, 0, n - 1) v[i] = a[i][0]; sort(all(v)); int bound = v[n / 2]; int prize = 0; rep(i, 0, n - 1) prize += abs(v[i] - bound); allocate_tickets(a); return prize; } int find_maximum(int k, vii a) { return sub1(a); }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc69ukbk.o: in function `sub1(std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > >)':
tickets.cpp:(.text+0x564): undefined reference to `allocate_tickets(std::vector<std::vector<long, std::allocator<long> >, std::allocator<std::vector<long, std::allocator<long> > > >)'
/usr/bin/ld: /tmp/ccPAEiLh.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