Submission #95839

# Submission time Handle Problem Language Result Execution time Memory
95839 2019-02-02T21:44:50 Z JustInCase popa (BOI18_popa) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "popa.h"

#define int32_t int
#define int64_t long long
#define Solve solve
#define Query query

const int32_t MAX_N = 1000;

std::vector< int32_t > l[MAX_N + 5], r[MAX_N + 5];

int32_t Query(int32_t a, int32_t b, int32_t c, int32_t d) {
	std::cout << a << " " << b << " " << c << " " << d << '\n';
	std::cout << std::flush;

	int32_t res;
	std::cin >> res;

	return res;
}

int32_t Solve(int32_t n, int32_t *left, int32_t *right) {
	memset(left, -1, n * 4);
	memset(right, -1, n * 4);
	int32_t root;

	if(Query(0, 1, 0, 0)) {
		root = 0;
		right[0] = 1;
	}
	else {
		root = 1;
		left[1] = 0;
	}


	for(int32_t i = 2; i < n; i++) {
		if(Query(i - 1, i, i, i)) {
			left[i] = root;
			root = i;
		}
		else {
			right[i - 1] = i;
		}
	}
}

/**
int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);

	int32_t left[6], right[6];
	int32_t ans = Solve(6, left, right);
	
	std::cout << ans << '\n';
	for(int32_t i = 0; i < 6; i++) {
		std::cout << left[i] << " " << right[i] << '\n';
	}
}
*/

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:47:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/tmp/ccZ2qa2X.o: In function `query(int, int, int, int)':
popa.cpp:(.text+0x60): multiple definition of `query(int, int, int, int)'
/tmp/ccY2xivg.o:grader.cpp:(.text+0x50): first defined here
collect2: error: ld returned 1 exit status