Submission #259495

# Submission time Handle Problem Language Result Execution time Memory
259495 2020-08-07T23:15:52 Z peti1234 Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
#define rep(n) for (int i=0; i<n; i++)
#define jrep(n) for (int j=0; j<n; j++)
const int c=202, f=25;
int pos, ua, nua, v[c], px[c], seg[c], seg2[c], sor[c], oszlop[c], nagy[c], kis[c], ans[c], id;
vector<int> sol;
void pb(int a) {
    sol.push_back(a);
}
int add(int a) {
    if (a==1) pos=(add_or(sol));
    if (a==2) pos=(add_and(sol));
    if (a==3) pos=(add_xor(sol));
    if (a==4) pos=(add_not(ua));
    sol.clear();
    return pos;
}
void calc(int n) {
    rep(n) pb(v[i]);
    ua=add(3), nua=add(4);
    rep(n) {
        if (i) pb(px[i-1]);
        pb(v[i]);
        px[i]=add(3);
    }
    for (int j=0; j<n; j+=f) {
        rep(n-j) pb(px[i]), pb(px[i+j]), seg[i]=add(2);
        rep(n-j) pb(seg[i]);
        nagy[j/f]=add(1);
        if (j) pb(nagy[j/f-1]), pb(nagy[j/f]), nagy[j/f-1]=add(3);
    }
    rep(f) {
        for (int j=i; j<n; j+=f) pb(v[j]);
        seg[i]=add(1);
    }
    rep(f) {
        if (!i) {
            rep(f) pb(seg[i]);
            kis[0]=add(3), i++;
        }
        jrep(f-i) pb(seg[j]), pb(seg[j+i]), seg2[j]=add(2);
        jrep(f-i) pb(seg2[j]);
        kis[i]=add(1);
    }
}
void construct_network(int n, int m, int k) {
    rep(n) {
        int p=m*i;
        rep(m) pb(p+i);
        v[i]=add(1);
    }
    calc(n);
    rep(n) {
        if (!i) {
            pb(ua);
            sor[i]=add(1), i++;
        }
        pb(nua), pb(kis[i%25]), pb(nagy[(i-1)/25]);
        sor[i]=add(2);
    }
    rep(m) {
        int p=i;
        rep(n) pb(p+m*i);
        v[i]=add(1);
    }
    calc(m);
    rep(m) {
        if (!i) {
            pb(ua);
            oszlop[i]=add(1), i++;
        }
        pb(nua), pb(kis[i%25]), pb(nagy[(i-1)/25]);
        oszlop[i]=add(2);
    }
    rep(n) {
        int j=k-i;
        if (j>=0 && j<m) pb(sor[i]), pb(oszlop[j]), ans[id]=add(2), id++;
    }
    rep(id) pb(ans[i]);
    add(1);
}









/*
int b1, b2, b3;
int main()
{
    cin >> b1 >> b2 >> b3;
    construct_network(b1, b2, b3);
    return 0;
}
*/

Compilation message

vision.cpp: In function 'int add(int)':
vision.cpp:13:20: error: 'add_or' was not declared in this scope
     if (a==1) pos=(add_or(sol));
                    ^~~~~~
vision.cpp:13:20: note: suggested alternative: 'add'
     if (a==1) pos=(add_or(sol));
                    ^~~~~~
                    add
vision.cpp:14:20: error: 'add_and' was not declared in this scope
     if (a==2) pos=(add_and(sol));
                    ^~~~~~~
vision.cpp:15:20: error: 'add_xor' was not declared in this scope
     if (a==3) pos=(add_xor(sol));
                    ^~~~~~~
vision.cpp:16:20: error: 'add_not' was not declared in this scope
     if (a==4) pos=(add_not(ua));
                    ^~~~~~~