답안 #152182

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
152182 2019-09-06T17:10:24 Z stefdasca Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
    int query_number = H * W - 1;
    vector<int>mn, sc;
    for(int i = H - 1; i >= 0; --i)
    {
        vector<int>pz;
        for(int a = i, b = 0; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        add_xor(pz);
        ++query_number;
        mn.push_back(query_number);
    }
    for(int i = 1; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        add_xor(pz);
        ++query_number;
        mn.push_back(query_number);
    }
    for(int i = 0; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        add_xor(pz);
        ++query_number;
        se.push_back(query_number);
    }
    for(int i = 1; i < H; ++i)
    {
        vector<int>pz;
        for(int a = i, b = W - 1; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        add_xor(pz);
        ++query_number;
        se.push_back(query_number);
    }
    vector<int>lst;
    for(int i = K; i < main.size(); ++i)
    {
        add_and({main[i-K], main[i]});
        ++query_number;
        lst.push_back(query_number);
    }
    for(int i = K; i < se.size(); ++i)
    {
        add_and({se[i-K], se[i]});
        ++query_number;
        lst.push_back(query_number);
    }
    add_or(lst);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:9: error: 'se' was not declared in this scope
         se.push_back(query_number);
         ^~
vision.cpp:33:9: note: suggested alternative: 'sc'
         se.push_back(query_number);
         ^~
         sc
vision.cpp:42:9: error: 'se' was not declared in this scope
         se.push_back(query_number);
         ^~
vision.cpp:42:9: note: suggested alternative: 'sc'
         se.push_back(query_number);
         ^~
         sc
vision.cpp:45:24: error: 'main' was not declared in this scope
     for(int i = K; i < main.size(); ++i)
                        ^~~~
vision.cpp:45:24: note: suggested alternative: 'mn'
     for(int i = K; i < main.size(); ++i)
                        ^~~~
                        mn
vision.cpp:47:37: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
         add_and({main[i-K], main[i]});
                                     ^
vision.cpp:51:24: error: 'se' was not declared in this scope
     for(int i = K; i < se.size(); ++i)
                        ^~
vision.cpp:51:24: note: suggested alternative: 'sc'
     for(int i = K; i < se.size(); ++i)
                        ^~
                        sc
vision.cpp:53:33: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
         add_and({se[i-K], se[i]});
                                 ^