Submission #795894

# Submission time Handle Problem Language Result Execution time Memory
795894 2023-07-27T20:40:04 Z APROHACK Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
int h, w, k;
int getPos(int x, int y){
	return x*w + y;
}

void construct_network(int H, int W, int K) {
	h = H;
	w = W;
	k = K;
	vector<int>todos;
	for(int i = 0 ; i < H ; i ++){
		for(int j = 0 ; j < W ; j ++){
			vector<int>cuales;
			for(int xi = 0 ; xi < H ; xi ++){
				for(int xj = 0; xj < W ; xj ++){
					if(abs(xi-i) + abs(xj-j) == k)cuales.pb(getPos(xi, xj));
				}
			}
			if(cuales.empty()){
				continue;
			}
			int idxOr = add_or(cuales)
			todos.pb(add_and({idxOr, getPos(i, j)}));
		}
	}
	add_or(todos);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:27:4: error: expected ',' or ';' before 'todos'
   27 |    todos.pb(add_and({idxOr, getPos(i, j)}));
      |    ^~~~~
vision.cpp:27:42: error: expected primary-expression before ')' token
   27 |    todos.pb(add_and({idxOr, getPos(i, j)}));
      |                                          ^
vision.cpp:26:8: warning: unused variable 'idxOr' [-Wunused-variable]
   26 |    int idxOr = add_or(cuales)
      |        ^~~~~