Submission #58571

# Submission time Handle Problem Language Result Execution time Memory
58571 2018-07-18T08:45:00 Z Mamnoon_Siam ICC (CEOI16_icc) C++17
0 / 100
400 ms 868 KB
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;

const int maxn = 105;

int n;
int ok[maxn][maxn];

int ask(vector<int> x, vector<int> y) {
	int size_a = x.size(), size_b = y.size();
	int a[size_a], b[size_b];
	for(int i = 0; i < size_a; i++) a[i] = x[i];
	for(int i = 0; i < size_b; i++) b[i] = y[i];
	return query(size_a, size_b, a, b);
}

int chex(int u) {
	vector<int> a = {u}, b;
	for(int i = 1; i <= n; i++) {
		if(i != u and !ok[u][i]) {
			b.push_back(i);
		}
	}
	if(b.empty()) return 0;
	return ask(a, b);
}
int find_another(int u) {
	for(int i = 1; i <= n; i++) {
		if(i != u and !ok[u][i]) {
			if(ask({u}, {i})) {
				return i;
			}
		}
	} assert(false);
}

void run(int N) {
	n = N;
	while(true) {
		int u = 0;
		for(int i = 1; i <= n; i++)
			if(chex(i)) { u = i; break; }
		int v = find_another(u);
		setRoad(u, v);
		ok[u][v] = ok[v][u] = 1;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 23 ms 504 KB Ok! 301 queries used.
2 Incorrect 21 ms 616 KB Wrong road!
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 692 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 252 ms 768 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 289 ms 768 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 400 ms 868 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 345 ms 868 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -