Submission #165962

# Submission time Handle Problem Language Result Execution time Memory
165962 2019-11-29T21:32:29 Z nickmet2004 Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;

int h , w , k;

vector<int> Dl[400500] , Dr[400500];

int solve(int h , int w , int K){
    for(int i = 0; i < h; ++i){
        for(int j = 0; j < w; ++j){
            // emplace back the elements on diagonals , position off memory array
            Dl[i - j].push_back(i * w + j);
            Dr[i + j + h - 1].push_back(i * w + j);
        }
    }
    vector<int> DiagLor , DiagRor , ans;
    for(int i = 0; i <= h + w - 2; ++i){
        DiagLor.push_back(add_or(Dl[i]));
        DiagRor.emplace_back(add_or(Dr[i]));
        if(i >= K){
            ans.push_back( add_and ( { DiagLor[i] , DiagLor[i - K] } ) );
            ans.push_back( add_and ( { DiagRor[i] , DiagRor[i - K] } ) );
        }
    }
    return add_or(ans);
}

void construct_network(int H , int W , int K){
    if(H + W - 2 == K){
        solve(H , W , K);
    } else {
        add_xor( { solve(H , W , K) , solve(H , W , K + 1) } );
    }
}
int main(){}

Compilation message

vision.cpp: In function 'int solve(int, int, int)':
vision.cpp:19:27: error: 'add_or' was not declared in this scope
         DiagLor.push_back(add_or(Dl[i]));
                           ^~~~~~
vision.cpp:19:27: note: suggested alternative: 'rand_r'
         DiagLor.push_back(add_or(Dl[i]));
                           ^~~~~~
                           rand_r
vision.cpp:22:28: error: 'add_and' was not declared in this scope
             ans.push_back( add_and ( { DiagLor[i] , DiagLor[i - K] } ) );
                            ^~~~~~~
vision.cpp:26:12: error: 'add_or' was not declared in this scope
     return add_or(ans);
            ^~~~~~
vision.cpp:26:12: note: suggested alternative: 'rand_r'
     return add_or(ans);
            ^~~~~~
            rand_r
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:9: error: 'add_xor' was not declared in this scope
         add_xor( { solve(H , W , K) , solve(H , W , K + 1) } );
         ^~~~~~~