답안 #644938

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644938 2022-09-25T15:47:21 Z a_aguilo Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
void construct_network(int H, int W, int K) {
	vector<int> possibilities;
	for(int i = 0; i < W; ++i){
        for(int j = 0; j < H; ++j){
            int PosAct = i + j*W;
            vector<int> AtDistanceK;
            AtDistanceK.push_back(PosAct);
            for(int w = 0; w <= K; ++w){
                int h = K - w;
                if(i + w < W){
                    if(j + h < H){
                        AtDistanceK.push_back((j+h)*W + i + w);
                    }
                    if(j - h >= 0){
                        AtDistanceK.push_back((j-h)*W + i + w);
                    }
                }
                if(i - w >= 0){
                    if(j + h < H){
                        AtDistanceK.push_back((j+h)*W + i - w);
                    }
                    if(j - h >= 0){
                        AtDistanceK.push_back((j-h)*W + i - w);
                    }
                }
            }
            int hasTwoOnes = add_and({add_or(AtDistanceK), add_not(add_xor(AtDistanceK))});
            possibilities.push_back(hasTwoOnes);
        }
	}
	add_or(possibilities);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:2:2: error: 'vector' was not declared in this scope
    2 |  vector<int> possibilities;
      |  ^~~~~~
vision.cpp:2:9: error: expected primary-expression before 'int'
    2 |  vector<int> possibilities;
      |         ^~~
vision.cpp:6:20: error: expected primary-expression before 'int'
    6 |             vector<int> AtDistanceK;
      |                    ^~~
vision.cpp:7:13: error: 'AtDistanceK' was not declared in this scope
    7 |             AtDistanceK.push_back(PosAct);
      |             ^~~~~~~~~~~
vision.cpp:27:39: error: 'add_or' was not declared in this scope
   27 |             int hasTwoOnes = add_and({add_or(AtDistanceK), add_not(add_xor(AtDistanceK))});
      |                                       ^~~~~~
vision.cpp:27:68: error: 'add_xor' was not declared in this scope
   27 |             int hasTwoOnes = add_and({add_or(AtDistanceK), add_not(add_xor(AtDistanceK))});
      |                                                                    ^~~~~~~
vision.cpp:27:60: error: 'add_not' was not declared in this scope
   27 |             int hasTwoOnes = add_and({add_or(AtDistanceK), add_not(add_xor(AtDistanceK))});
      |                                                            ^~~~~~~
vision.cpp:27:30: error: 'add_and' was not declared in this scope
   27 |             int hasTwoOnes = add_and({add_or(AtDistanceK), add_not(add_xor(AtDistanceK))});
      |                              ^~~~~~~
vision.cpp:28:13: error: 'possibilities' was not declared in this scope
   28 |             possibilities.push_back(hasTwoOnes);
      |             ^~~~~~~~~~~~~
vision.cpp:31:9: error: 'possibilities' was not declared in this scope
   31 |  add_or(possibilities);
      |         ^~~~~~~~~~~~~
vision.cpp:31:2: error: 'add_or' was not declared in this scope
   31 |  add_or(possibilities);
      |  ^~~~~~