Submission #57860

# Submission time Handle Problem Language Result Execution time Memory
57860 2018-07-16T11:58:35 Z fredbr ICC (CEOI16_icc) C++17
0 / 100
28 ms 696 KB
#include <bits/stdc++.h>
#include "icc.h"

using namespace std;

const int maxn = 110;

int roads = 0;

void solve(int x, int l, int r)
{
	if (l == r) {

		setRoad(x, l);
		roads++;
		return;
	}

	int m = (l+r)/2;

	vector<int> xc = {x};

	vector<int> lc;
	for (int i = l; i <= m; i++)
		lc.push_back(i);

	vector<int> rc;
	for (int i = m+1; i <= r; i++)
		rc.push_back(i);

	int lans = query(1, m-l+1, xc.data(), lc.data());
	int rans = query(1, r-m, xc.data(), rc.data());

	if (lans) solve(x, l, m);
	if (rans) solve(x, m+1, r);
}

void run(int n)
{
	for (int i = 1; i < n and roads < n-1; i++)
		solve(i, i+1, n);
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 504 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 616 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 696 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 696 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 696 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 696 KB Not all edges were guessed!
2 Halted 0 ms 0 KB -