Submission #1048410

# Submission time Handle Problem Language Result Execution time Memory
1048410 2024-08-08T07:26:52 Z TahirAliyev Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			if(add_not(i * W + j)) continue;
			vector<int> v;
			for(int k = 0; k < H; k++){
				int x = i + k, y = j + K - k;
				if(x < 0 || x >= H || y < 0 || y >= W) continue;
				v.push_back(x * W + y);
				int x = i + k, y = j - (K - k);
				if(x < 0 || x >= H || y < 0 || y >= W) continue;
				v.push_back(x * W + y);
			}
			if(add_or(v)) return;
		}
	}
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:14:9: error: redeclaration of 'int x'
   14 |     int x = i + k, y = j - (K - k);
      |         ^
vision.cpp:11:9: note: 'int x' previously declared here
   11 |     int x = i + k, y = j + K - k;
      |         ^
vision.cpp:14:20: error: redeclaration of 'int y'
   14 |     int x = i + k, y = j - (K - k);
      |                    ^
vision.cpp:11:20: note: 'int y' previously declared here
   11 |     int x = i + k, y = j + K - k;
      |                    ^