Submission #152140

# Submission time Handle Problem Language Result Execution time Memory
152140 2019-09-06T15:29:24 Z stefdasca Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
    /*
	vector<int> Ns;
	Ns = {0, 1};
	int a = add_and(Ns);
	Ns = {0, a};
	int b = add_or(Ns);
	Ns = {0, 1, b};
	int c = add_xor(Ns);
	add_not(c);
	*/
	int fi = H * W;
	int lst = H * W - 1;
	for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
            add_not(i * W + j), ++lst;
    int fi2 = lst + 1;
    int lst2 = lst;
	for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
        {
            vector<int>vec;
            for(int q = 0; q < H; ++q)
                for(int z = 0; z < W; ++z)
                    if(abs(i - q) + abs(j - z) == K)
                        vec.pb(q * W + z);
            add_and({add_and(i * W + j), add_and(vec)});
            ++lst2;
        }
    vector<int>s;
    for(int i = fi2; i <= lst2; ++i)
        s.push_back(i);
    add_or(s);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:29: error: 'class std::vector<int>' has no member named 'pb'
                         vec.pb(q * W + z);
                             ^~
vision.cpp:31:36: error: could not convert '((i * W) + j)' from 'int' to 'std::vector<int>'
             add_and({add_and(i * W + j), add_and(vec)});
                              ~~~~~~^~~
vision.cpp:31:55: error: could not convert '{<expression error>, add_and(std::vector<int>(vec))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
             add_and({add_and(i * W + j), add_and(vec)});
                                                       ^
vision.cpp:16:6: warning: unused variable 'fi' [-Wunused-variable]
  int fi = H * W;
      ^~