Submission #1130238

#TimeUsernameProblemLanguageResultExecution timeMemory
1130238sohamsen15Dancing Elephants (IOI11_elephants)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 999999; vector<ll> a; ll n, l; void init(ll N, ll L, vector<ll> X) { n = N; l = L; for (auto x: X) a.push_back(x); } ll update(ll idx, ll y) { a[idx] = y; vector<ll> b; for (auto &x: a) b.push_back(x); sort(b.begin(), b.end()); ll ans = 0; for (ll i = 0; i < n;) { ans++; bool done = false; for (ll j = i + 1; j < n; j++) { if (b[j] - b[i] > l) { done = true; i = j; break; } else if (j == n - 1) { i = n; done = true; } } if (!done) i++; } return ans; }

Compilation message (stderr)

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