Submission #587922

# Submission time Handle Problem Language Result Execution time Memory
587922 2022-07-02T14:12:50 Z ogibogi2004 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) {

    if(K==1)
    {
        int c1[W],r1[H],c2[W],r2[H];
        for(int i=0;i<H;i++)
        {
            vector<int>v;
            for(int j=0;j<W;j++)v.push_back(i*W+j);
            r1[i]=add_or(v);
        }
        for(int i=0;i<H-1;i++)
        {
            vector<int>v;
            for(int j=0;j<W;j++)v.push_back(i*W+j);
            for(int j=0;j<W;j++)v.push_back((i+1)*W+j);
            r2[i]=add_or(v);
        }
        for(int j=0;j<W;j++)
        {
            vector<int>v;
            for(int i=0;i<H;i++)v.push_back(W*i+j);
            c1[j]=add_or(v);
        }
        for(int j=0;j<W-1;j++)
        {
            vector<int>v;
            for(int i=0;i<H;i++)v.push_back(W*i+j);
            for(int i=0;i<H;i++)v.push_back(W*(i+1)+j);
            c2[j]=add_or(v);
        }
        int cc1,cc2,rr1,rr2;
        vector<int>v;


        v.clear();
        for(int i=0;i<W;i++)v.push_back(c1[i]);
        cc1=add_xor(v);

        v.clear();
        for(int i=0;i<H;i++)v.push_back(r1[i]);
        rr1=add_xor(v);

        v.clear();
        for(int i=0;i<W-1;i++)v.push_back(c2[i]);
        cc2=add_xor(v);

        v.clear();
        for(int i=0;i<H-1;i++)v.push_back(r2[i]);
        rr2=add_xor(v);
        int case1=add_and(cc1,rr2);
        int case2=add_and(cc2,rr1);
        add_or(case1,case2);
        return;
    }
    vector<int>v;
    for(int i=0;i<H;i++)
    {
        for(int j=0;j<W;j++)
        {
            if(i+j==K)v.push_back(i*W+j);
        }
    }
    add_or(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:55:27: error: could not convert 'cc1' from 'int' to 'std::vector<int>'
   55 |         int case1=add_and(cc1,rr2);
      |                           ^~~
      |                           |
      |                           int
vision.cpp:56:27: error: could not convert 'cc2' from 'int' to 'std::vector<int>'
   56 |         int case2=add_and(cc2,rr1);
      |                           ^~~
      |                           |
      |                           int
vision.cpp:57:16: error: could not convert 'case1' from 'int' to 'std::vector<int>'
   57 |         add_or(case1,case2);
      |                ^~~~~
      |                |
      |                int