Submission #144133

# Submission time Handle Problem Language Result Execution time Memory
144133 2019-08-16T07:45:06 Z icypiggy Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <vector>
using namespace std;
void construct_network(int H, int W, int K) {
    vector<int> vdiag[H+W-1];
    vector<int> vdiag2[H+W-1];
    int idx_diag[H+W-1];
    int idx_diag2[H+W-1];
    for(int i=0; i<H; i++) {
        for(int j=0; j<W; j++) {
            vdiag[i+j].push_back(i*W+j);
            vdiag2[H-1-i+j].push_back(i*W+j);
            //cout << "vdiag: " << i*W+j << " " << i+j << " " << H-1-i+j << "\n";
        }
    }
    for(int i=0; i<H+W-1; i++) {
        idx_diag[i] = add_or(vdiag[i]);
    }

    for(int i=0; i<H+W-1; i++) {
        idx_diag2[i] = add_or(vdiag2[i]);
    }
    vector<int> tmp;
    for(int i=0; i+K<H+W-1; i++) {
        tmp.push_back(add_and({idx_diag[i], idx_diag[i+K]}));
        tmp.push_back(add_and({idx_diag2[i], idx_diag2[i+K]}));
    }
    vector<int> tmp2; // if any fail, we fail
    vector<int> vtmp;
    vector<int> vtmp2;
    for(int i=H+W-2; i>K; i--) {
        vtmp.push_back(idx_diag[i]);
        vtmp2.push_back(idx_diag2[i]);
        //cout << idx_diag[i] << "!!!\n";
    }
    for(int i=0; i+K<H+W-2; i++) {
        /*cout << i << ": ";
        for(int i: vtmp) {
            cout << i << " ";
        }
        cout << "\n";*/
        tmp2.push_back(add_and({idx_diag[i], add_or(vtmp)}));
        tmp2.push_back(add_and({idx_diag2[i], add_or(vtmp2)}));
        vtmp.pop_back();
        vtmp2.pop_back();
    }
    //add_or(tmp);
    add_and({add_or(tmp), add_not(add_or(tmp2))});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:16:23: error: 'add_or' was not declared in this scope
         idx_diag[i] = add_or(vdiag[i]);
                       ^~~~~~
vision.cpp:20:24: error: 'add_or' was not declared in this scope
         idx_diag2[i] = add_or(vdiag2[i]);
                        ^~~~~~
vision.cpp:24:23: error: 'add_and' was not declared in this scope
         tmp.push_back(add_and({idx_diag[i], idx_diag[i+K]}));
                       ^~~~~~~
vision.cpp:41:46: error: 'add_or' was not declared in this scope
         tmp2.push_back(add_and({idx_diag[i], add_or(vtmp)}));
                                              ^~~~~~
vision.cpp:41:24: error: 'add_and' was not declared in this scope
         tmp2.push_back(add_and({idx_diag[i], add_or(vtmp)}));
                        ^~~~~~~
vision.cpp:47:14: error: 'add_or' was not declared in this scope
     add_and({add_or(tmp), add_not(add_or(tmp2))});
              ^~~~~~
vision.cpp:47:27: error: 'add_not' was not declared in this scope
     add_and({add_or(tmp), add_not(add_or(tmp2))});
                           ^~~~~~~
vision.cpp:47:5: error: 'add_and' was not declared in this scope
     add_and({add_or(tmp), add_not(add_or(tmp2))});
     ^~~~~~~