답안 #152157

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
152157 2019-09-06T15:50:46 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)
{
    bool sk[302][302];
    int qu1[302][302], qu2[302][302];
    memset(sk, 0, sizeof(sk));
    memset(qu1, 0, sizeof(qu1));
    memset(qu2, 0, sizeof(qu2));
    int query_number = H * W;
    for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
        {
            vector<int>pz;
            for(int p = 0; p < H; ++p)
                for(int z = 0; z < W; ++z)
                    if(abs(i - p) + abs(j - z) == K)
                        pz.pb({P * W + z});
            if(!pz.size())
                sk[i][j] = 1;
            else
                qu1[i][j] = query_number, add_or(pz), ++query_number;
        }
    for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
        {
            if(sk[i][j])
                continue;
            add_and(i * W + j);
            qu2[i][j] = query_number;
            ++query_number;
        }
    int lst = query_number;
    vector<int>p;
    for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
            if(!sk[i][j])
                p.push_back(query_number), add_and(qu1[i][j], qu2[i][j]), ++query_number;
    add_or(p);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:19:28: error: 'class std::vector<int>' has no member named 'pb'
                         pz.pb({P * W + z});
                            ^~
vision.cpp:19:32: error: 'P' was not declared in this scope
                         pz.pb({P * W + z});
                                ^
vision.cpp:30:27: error: could not convert '((i * W) + j)' from 'int' to 'std::vector<int>'
             add_and(i * W + j);
                     ~~~~~~^~~
vision.cpp:39:60: error: could not convert 'qu1[i][j]' from 'int' to 'std::vector<int>'
                 p.push_back(query_number), add_and(qu1[i][j], qu2[i][j]), ++query_number;
                                                    ~~~~~~~~^
vision.cpp:34:9: warning: unused variable 'lst' [-Wunused-variable]
     int lst = query_number;
         ^~~