Submission #600606

# Submission time Handle Problem Language Result Execution time Memory
600606 2022-07-21T06:11:47 Z MadokaMagicaFan Bit Shift Registers (IOI21_registers) C++17
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
const ll inf = 1e9;
const int md1 = 1e9+7;
const int md2 = 998244353;

#define sz(v)                       ((int)v.size())
#define pb                          push_back

#define pry                         cout << "YES\n"
#define prn                         cout << "NO\n"
#define endl                        '\n'

#define fst                         first
#define scn                         second
/* #define ONPC */

void append_move(int t, int y);
void append_store(int t, vector<bool>& v);
void append_and(int t, int x, int y);
void append_or(int t, int x, int y);
void append_xor(int t, int x, int y);
void append_not(int t, int x);
void append_left(int t, int x, int p);
void append_right(int t, int x, int p);
void append_add(int t, int x, int y);

void
construct_instructions(int s, int n, int k, int q)
{
    assert(!s);
    vector<bool> v(2000);

    append_store(0, v);
    vector<int> a(n, 0);

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < k; ++j) {
            if(v[i*k+j]) a[i] += (1<<j);
        }
    }

    int mn = 0;

    for (int i = 0; i < n; ++i)
        if (a[i] < a[mn]) mn = i;

    append_right(1,0,mn*k);
    append_right(2,1,k);
    append_left(2,2,k);
    append_xor(0,1,2);

    return;
}


#ifdef ONPC
void append_move(int t, int y);
void append_store(int t, vector<bool> v);
void append_and(int t, int x, int y);
void append_or(int t, int x, int y);
void append_xor(int t, int x, int y);
void append_not(int t, int x);
void append_left(int t, int x, int p);
void append_right(int t, int x, int p);
void append_add(int t, int x, int y);

const int B = 2000;
const int M = 100;

vector<array<bool,B>> r(M);

void
solve()
{

}

int32_t
main(int argc, char **argv)
{
    if (argc >= 2) {
        freopen(argv[1], "r", stdin);
    } else
        ios_base::sync_with_stdio(0);cin.tie(0);
    int t = 1;
    /* cin >> t; */
    while(t--)
        solve();
}
#endif

Compilation message

/usr/bin/ld: /tmp/ccsUppf9.o: in function `construct_instructions(int, int, int, int)':
registers.cpp:(.text+0xdf): undefined reference to `append_store(int, std::vector<bool, std::allocator<bool> >&)'
collect2: error: ld returned 1 exit status