제출 #1012595

#제출 시각아이디문제언어결과실행 시간메모리
1012595ProtonDecay314Carnival Tickets (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
/* */ #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pi; typedef pair<ll, ll> pll; typedef vector<pi> vpi; typedef vector<pll> vpll; typedef vector<bool> vb; #define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #define L(varll, mn, mx) for(ll varll = (mn); varll < (mx); varll++) #define LR(varll, mx, mn) for(ll varll = (mx); varll > (mn); varll--) #define LI(vari, mn, mx) for(int vari = (mn); vari < (mx); vari++) #define LIR(vari, mx, mn) for(int vari = (mx); vari > (mn); vari--) #define INPV(varvec) for(auto& varveci : (varvec)) cin >> varveci #define fi first #define se second #define pb push_back #define TCASES int t; cin >> t; while(t--) #ifndef DEBUG #include "tickets.h" #endif #ifdef DEBUG vvi ta; void allocate_tickets(const vvi& a_ta) { LI(i, 0, (int)ta.size()) { copy(a_ta[i].begin(), a_ta[i].end(), back_inserter(ta[i])); } } #endif ll find_maximum(int k, const vvi& x) { int n = x.size(), m = x[0].size(); vvi talloc; LI(i, 0, n) { vi tallocr(m, -1); talloc.pb(tallocr); } ll ans = 0ll; // Subtask 1 if(m == 1) { vi vals; LI(i, 0, n) { vals.pb(x[i][0]); } sort(vals.begin(), vals.end()); LI(i, 0, n >> 1) { ans -= (ll)vals[i]; } LI(i, n >> 1, n) { ans += (ll)vals[i]; } LI(i, 0, n) { talloc[i][0] = 0; } } allocate_tickets(talloc); return ans; } #ifdef DEBUG int main() { int n, m, k; cin >> n >> m >> k; vvi x; LI(i, 0, n) { vi xr(m, 0); vi tar; INPV(xr); x.pb(xr); ta.pb(tar); } cout << find_maximum(k, x) << "\n"; LI(i, 0, n) { LI(j, 0, m) cout << ta[i][j] << " "; cout << "\n"; } return 0; } #endif

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

/usr/bin/ld: /tmp/cc3Q2mBP.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