Submission #1106268

# Submission time Handle Problem Language Result Execution time Memory
1106268 2024-10-29T17:15:52 Z vladilius Painting Walls (APIO20_paint) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
const int inf = 3e5;

struct DS{
    vector<int> a, f;
    int n, mx;
    DS(int ns){
        n = ns;
        a.resize(n + 1);
        f.resize(n + 1);
        f[0] = n;
        mx = 0;
    }
    void upd(int p, int x){
        p++;
        if (x == 1){
            f[a[p]]--;
            a[p]++;
            f[a[p]]++;
            mx = max(mx, a[p]);
        }
        else {
            if (a[p] == mx && f[a[p]] == 1) mx--;
            f[a[p]]--;
            a[p]--;
            f[a[p]]++;
        }
    }
    int get(){
        return mx;
    }
};

Compilation message

/usr/bin/ld: /tmp/cctIVi4H.o: in function `main':
grader.cpp:(.text.startup+0x392): undefined reference to `minimumInstructions(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status