Submission #815107

# Submission time Handle Problem Language Result Execution time Memory
815107 2023-08-08T12:27:00 Z PagodePaiva Vision Program (IOI19_vision) C++14
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) {
	// std::vector<int> Ns;
	// Ns = {0, 1};
	// int a = add_and(Ns);
	// Ns = {0, a};
	// int b = add_or(Ns);
	// Ns = {0, 1, b};
	// int c = add_xor(Ns);
	// add_not(c);

	int n = H, m = W, k = K;

	pair <int, int> v[2];
	int con = 0;

	for(int i = 0;i < n;i++){
		for(int j = 0;j < m;j++){
			int r = add_and({h*i+j});
			if(r == 1){
				v[con] = {i, j};
				con++;
			} 
		}
	}

	int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
	if(res == k) add_or({1});
	else add_or({0});

	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:25:21: error: 'h' was not declared in this scope
   25 |    int r = add_and({h*i+j});
      |                     ^
vision.cpp:25:27: error: could not convert '{<expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   25 |    int r = add_and({h*i+j});
      |                           ^
      |                           |
      |                           <brace-enclosed initializer list>
vision.cpp:33:21: error: 'struct std::pair<int, int>' has no member named 'fr'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                     ^~
vision.cpp:33:31: error: 'struct std::pair<int, int>' has no member named 'fr'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                               ^~
vision.cpp:33:46: error: 'struct std::pair<int, int>' has no member named 'sc'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                                              ^~
vision.cpp:33:56: error: 'struct std::pair<int, int>' has no member named 'sc'
   33 |  int res = abs(v[0].fr - v[1].fr) + abs(v[0].sc - v[1].sc);
      |                                                        ^~