Submission #305524

# Submission time Handle Problem Language Result Execution time Memory
305524 2020-09-23T12:45:00 Z azberjibiou Vision Program (IOI19_vision) C++17
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> v;
    for(int i=0;i<H;i++)
    {
        v.clear();
        for(int j=0;j<W;j++)
        {
            v.push_back(W*i+j);
        }
        add_or(v);
    }
    for(int i=0;i<W;i++)
    {
        v.clear();
        for(int j=0;j<H;j++)
        {
            v.push_back(W*j+i);
        }
        add_or(v);
    }
    vector <int> Hh, Ww, tmp;
    Hh.resize(H), Ww.resize(W);
    for(int i=1;i<H;i++)
    {
        if(i>K) break;
        v.clear();
        for(int j=0;j<H-i;j++)
        {
            v.push_back(add_and({HW+j, HW+i+j}));
        }
        Hh[i]=add_or(v);
    }
    v.clear();
    for(int i=0;i<H;i++)    v.push_back(H*W+i);
    Hh[0]=add_xor(v);
    for(int i=1;i<W;i++)
    {
        if(i>K) break;
        v.clear();
        for(int j=0;j<W-i;j++)
        {
            v.push_back(add_and({H*W+H+j, H*W+H+i+j}));
        }
        Ww[i]=add_or(v);
    }
    v.clear();
    for(int i=0;i<W;i++)    v.push_back(H*W+H+i);
    Ww[0]=add_xor(v);
    v.clear();
    for(int i=0;i<=K;i++)
    {
        if(i>=H || K-i>=W)    continue;
        v.push_back(add_and({Hh[i], Ww[K-i]}));
    }
    add_or(tmp);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:32:34: error: 'HW' was not declared in this scope; did you mean 'Hh'?
   32 |             v.push_back(add_and({HW+j, HW+i+j}));
      |                                  ^~
      |                                  Hh
vision.cpp:32:47: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   32 |             v.push_back(add_and({HW+j, HW+i+j}));
      |                                               ^
      |                                               |
      |                                               <brace-enclosed initializer list>