Submission #1270541

#TimeUsernameProblemLanguageResultExecution timeMemory
1270541BlockOGRobots (IOI13_robots)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> // mrrrow meeow :3 // go play vivid/stasis now! https://vividstasis.gay #define fo(i, a, b) for (auto i = (a); i < (b); i++) #define of(i, a, b) for (auto i = (b); i-- > (a);) #define f first #define s second #define pb push_back #define pob pop_back #define lb lower_bound #define ub upper_bound #define be(a) a.begin(), a.end() using namespace std; int ____init = [] { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return 0; }(); int xw[1000000]; int ys[1000000]; bool check(int a, int b, int t, int x[], int y[], int c) { set<pair<int, int>> s; fo(i, 0, t) s.insert({xw[i], i}); fo(i, 0, a) { fo(_, 0, c) { auto it = s.ub({i, t}); if (it == s.begin()) break; s.erase(--it); } } set<pair<int, int>> s2; for (auto [_, i] : s) s2.insert({ys[i], i}); of(i, 0, b) { fo(_, 0, c) { auto it = s2.ub({i, t}); if (it == s2.begin()) { if (s2.size()) return false; break; } s2.erase(--it); } } return s2.empty(); } int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) { sort(x, x + a); sort(y, y + b); fo(i, 0, t) { xw[i] = x + a - ub(x, x + a, w[i]); ys[i] = y + b - ub(y, y + b, s[i]); if (xw[i] < 1 && ys[i] < 1) return -1; } int l = 1, r = t; while (l < r) { int mid = (l + r) / 2; if (check(a, b, t, x, y, mid)) r = mid; else l = mid + 1; cerr << endl; } cerr << check(a, b, t, x, y, l) << endl; return l; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccokWwCg.o: in function `main':
grader.c:(.text.startup+0x1a1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status