답안 #291813

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
291813 2020-09-05T20:01:15 Z medmdg Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
void construct_network(int H, int W, int K){
    vector<int> hori;
    vector<int> vert;
    int bh=H*W;
    int eh;
    for(int i=0;i<H;i++){
        vector<int> al;
        for(int j=0;j<W;j++){
            al.push_back(j+i*W);
        }
        eh=add_or(al);
        hori.push_back(eh);
    }
    int bv=eh+1;
    int ev;
    for(int i=0;i<W;i++){
        vector<int> al;
        for(int j=i;j<H*W;j+=W){
            al.push_back(j);
        }
        ev=add_or(al);
        vert.push_back(ev);
    }
    vector<int> dishori;
    vector<int> disvert;
    int end=ev;
    vector<int> 0H;
    for(int i=bh;i<=eh;i++){
        0H.push_back(i);
    }
    dishori.push_back(add_xor(0H));
    vector<int> 0V;
    for(int i=bv;i<=ev;i++){
        0V.push_back(i);
    }
    disvert.push_back(add_xor(0V));
    end+=2;
    for(int i=1;i<=min(H-1,K);i++){
        vector<int> h;
        for(int j=bh;j<=eh-i;j++){
            vector<int> hp;
            hp.push_back(j);
            hp.push_back(j+i);
            end=add_and(hp);
            h.push_back(end);
        }
        if(h.size()){
            dishori.push_back(add_or(h));
            end++;
        }
    }
    for(int i=1;i<=min(W-1,K);i++){
        vector<int> h;
        for(int j=bv;j<=ev-i;j++){
            vector<int> hp;
            hp.push_back(j);
            hp.push_back(j+i);
            end=add_and(hp);
            h.push_back(end);
        }
        if(h.size()){
            disvert;push_back(add_or(h));
            end++;
        }
    }
    int last;
    for(int i=0;i<=K;i++){
        if(disvert.size()>i&&dishori.size()>K-i){
            vector<int> f;
            f.push_back(disvert[i]);
            f.push_back(dishori[K-i]);
            last.push_back(add_and(f));
        }
    }
    vector<int> nb;
    for(int i=end+1;i<=last;i++){
        nb.push_back(i);
    }
    last=add_or(nb);
    return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:17: error: expected unqualified-id before numeric constant
   30 |     vector<int> 0H;
      |                 ^~
vision.cpp:32:9: error: unable to find numeric literal operator 'operator""H.push_back'
   32 |         0H.push_back(i);
      |         ^~~~~~~~~~~~
vision.cpp:32:9: note: use '-fext-numeric-literals' to enable more built-in suffixes
vision.cpp:34:31: error: unable to find numeric literal operator 'operator""H'
   34 |     dishori.push_back(add_xor(0H));
      |                               ^~
vision.cpp:34:31: note: use '-fext-numeric-literals' to enable more built-in suffixes
vision.cpp:35:17: error: expected unqualified-id before numeric constant
   35 |     vector<int> 0V;
      |                 ^~
vision.cpp:37:9: error: unable to find numeric literal operator 'operator""V.push_back'
   37 |         0V.push_back(i);
      |         ^~~~~~~~~~~~
vision.cpp:37:9: note: use '-fext-numeric-literals' to enable more built-in suffixes
vision.cpp:39:31: error: unable to find numeric literal operator 'operator""V'
   39 |     disvert.push_back(add_xor(0V));
      |                               ^~
vision.cpp:39:31: note: use '-fext-numeric-literals' to enable more built-in suffixes
vision.cpp:65:13: warning: statement has no effect [-Wunused-value]
   65 |             disvert;push_back(add_or(h));
      |             ^~~~~~~
vision.cpp:65:21: error: 'push_back' was not declared in this scope
   65 |             disvert;push_back(add_or(h));
      |                     ^~~~~~~~~
vision.cpp:71:26: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   71 |         if(disvert.size()>i&&dishori.size()>K-i){
      |            ~~~~~~~~~~~~~~^~
vision.cpp:71:44: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   71 |         if(disvert.size()>i&&dishori.size()>K-i){
      |                              ~~~~~~~~~~~~~~^~~~
vision.cpp:75:18: error: request for member 'push_back' in 'last', which is of non-class type 'int'
   75 |             last.push_back(add_and(f));
      |                  ^~~~~~~~~