Submission #526611

#TimeUsernameProblemLanguageResultExecution timeMemory
526611MonarchuwuBubble Sort 2 (JOI18_bubblesort2)C++17
Compilation error
0 ms0 KiB
#include<iostream> #include<algorithm> using namespace std; typedef long long ll; const int N = 5e5 + 5; int n, q; int a[N]; int b[N]; void update(int p, int old_val, int new_val) { b[p] = 0; for (int i = 0; i < p; ++i) b[p] += a[i] > new_val; for (int i = p + 1; i < n; ++i) { b[i] -= old_val > a[i]; b[i] += new_val > a[i]; } } int query() { return *max_element(b, b + n); } int main() { cin.tie(NULL)->sync_with_stdio(false); cin >> n >> q; for (int i = 0; i < n; ++i) cin >> a[i], update(i, 0, a[i]); int x, v; while (q--) { cin >> x >> v; update(x, a[x], v); a[x] = v; cout << query() << '\n'; } } /** /\_/\ * (= ._.) * / >0 \>1 **/

Compilation message (stderr)

/usr/bin/ld: /tmp/ccTLbNas.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccqzyuhr.o:bubblesort2.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccTLbNas.o: in function `main':
grader.cpp:(.text.startup+0x181): undefined reference to `countScans(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status