Submission #815110

# Submission time Handle Problem Language Result Execution time Memory
815110 2023-08-08T12:27:32 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({n*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: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);
      |                                                        ^~