답안 #1063664

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1063664 2024-08-17T22:43:36 Z aaaaaarroz Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

bool limites(int x, int y, int h, int w) {
    return x >= 0 && x < h && y >= 0 && y < w;
}
void construct_network(int H, int W, int K) {
    map<int,pair<int, int>> numero;
    int pos = 0;
	vector<int>black;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            numero[pos] = {i,j};
			bool is_bl=add_or({pos});
			if(is_bl){
				black.push_back(pos;)
			}
            pos++;
        }
    }
    int dist=abs(numero[black[0]].first-numero[black[1]].first)+abs(numero[black[0]].second-numero[black[1]].second);
	if(dist==K){
		add_or({black[0]});
		return;
	}
	else{
		for(int i=0;i<H*W;i++){
			if(black[0]!=i&&black[1]!=i){
				add_or({i});
				return;
			}
		}
	}
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:24: error: expected ')' before ';' token
   17 |     black.push_back(pos;)
      |                    ~   ^
      |                        )
vision.cpp:17:25: error: expected primary-expression before ')' token
   17 |     black.push_back(pos;)
      |                         ^