Submission #1167544

#TimeUsernameProblemLanguageResultExecution timeMemory
1167544sleepntsheepChameleon's Love (JOI20_chameleon)C++20
0 / 100
0 ms400 KiB
#include "chameleon.h"
#include <vector>


namespace {

int variable_example = 1;

}  // namespace

void Solve(int N) {
	int x[55][55];
	for (int i = 1; i <= N; ++i)
		for (int j = i + 1; j <= N; ++j)
			x[i][j] = x[j][i] = Query(std::vector<int>{i, j});

	for (int i = 1; i <= N; ++i) {
		for (int c = 1; c <= N; ++c) {
			if (c == i || Query(std::vector<int>{c, i}) > 1)
				continue;

			int ok = 1;
			for (int k = 1; k <= N; ++k)
				if (k != i && c != k
					&& Query(std::vector<int>{i, c, k}) != x[i][k])
					ok=0;
			if(ok) {
				Answer(i, c);
				goto X;
			}

		}

X:;
	}
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...