Submission #551351

#TimeUsernameProblemLanguageResultExecution timeMemory
551351tabrHoliday (IOI14_holiday)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif int n; vector<pair<int, int>> c; void init(int n_, int a[], int b[]) { n = n_; for (int i = 0; i < n; i++) { c.emplace_back(a[i], b[i]); } sort(c.begin(), c.end()); } int can(int m, int k[]) { if (accumulate(k, k + m, 0LL) > n) { return 0; } vector<int> d(n + 1); for (int i = 0; i < m; i++) { d[k[i]] += k[i]; } int id = 0; multiset<int> st; for (int i = 1; i <= n; i++) { while (id < n && c[id].first == i) { st.emplace(c[id].second); id++; } if ((int) st.size() < d[i]) { return 0; } for (int j = 0; j < d[i]; j++) { st.erase(st.begin()); } st.erase(i); } return 1; } #ifdef tabr int main() { ios::sync_with_stdio(false); cin.tie(0); return 0; } #endif

Compilation message (stderr)

/usr/bin/ld: /tmp/ccseHsu7.o: in function `main':
grader.cpp:(.text.startup+0xaf): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status