Submission #723836

# Submission time Handle Problem Language Result Execution time Memory
723836 2023-04-14T10:53:32 Z GrandTiger1729 Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include "vision.h"
#ifndef EVAL
#include "grader.cpp"
#endif

#include <bits/stdc++.h>
using namespace std;

void construct_network(int n, int m, int K){
	vector<int> res(n);
	auto idx = [&](int i, int j) -> int {
		return i * m + j;
	};
	int cur = n * m;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m - 1; j++){
			add_and({idx(i, j), idx(i, j + 1)});
			cur++;
		}
	for (int i = 0; i < n - 1; i++)
		for (int j = 0; j < m; j++){
			add_and({idx(i + 1, j), idx(i, j)});
		}
	vector<int> res;
	for (int i = n * m; i < cur; i++)
		res.push_back(i);
	add_or(res);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:24:14: error: redeclaration of 'std::vector<int> res'
   24 |  vector<int> res;
      |              ^~~
vision.cpp:10:14: note: 'std::vector<int> res' previously declared here
   10 |  vector<int> res(n);
      |              ^~~