Submission #146710

# Submission time Handle Problem Language Result Execution time Memory
146710 2019-08-25T13:19:44 Z daniel920712 Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <stdlib.h>
#include <vision.h>

using namespace std;
vector < int > temp;
vector < int > temp2;
vector < int > all;
void construct_network(int H, int W, int K)
{
    int i,j;
    for(i=0;i<H;i++)
    {
        for(j=0;j<W;j++)
        {
            temp.clear();
            for(k=0;k<=K;k++) if(i+k<H&&j+(K-k)<W) temp.push_back(!add_not((i+K)*H+j+(K-k)));
            if(!temp.empty())
            {
                temp2.clear();
                temp2.push_back(!add_not(i*H+j));
                temp2.push_back(add_or(temp));
                all.push_back(add_and(temp2));
            }



        }
    }
    add_or(all);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:20:17: error: 'k' was not declared in this scope
             for(k=0;k<=K;k++) if(i+k<H&&j+(K-k)<W) temp.push_back(!add_not((i+K)*H+j+(K-k)));
                 ^