Submission #1167543

#TimeUsernameProblemLanguageResultExecution timeMemory
1167543sleepntsheepChameleon's Love (JOI20_chameleon)C++20
Compilation error
0 ms0 KiB
#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:;
	}
}

Compilation message (stderr)

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:13:45: error: 'Query' was not declared in this scope
   13 |                         x[i][j] = x[j][i] = Query(std::vector<int>{i, j});
      |                                             ^~~~~
chameleon.cpp:17:39: error: 'Query' was not declared in this scope
   17 |                         if (c == i || Query(std::vector<int>{c, i}) > 1)
      |                                       ^~~~~
chameleon.cpp:23:44: error: 'Query' was not declared in this scope
   23 |                                         && Query(std::vector<int>{i, c, k}) != x[i][k])
      |                                            ^~~~~
chameleon.cpp:26:33: error: 'Answer' was not declared in this scope
   26 |                                 Answer(i, c);
      |                                 ^~~~~~