Submission #1050972

# Submission time Handle Problem Language Result Execution time Memory
1050972 2024-08-09T17:29:44 Z rainboy How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
15 / 100
1 ms 344 KB
#include "avoid.h"
#include <vector>

using namespace std;

const int N = 1000, L = 10;

typedef vector<int> vi;
typedef pair<int, int> pi;

pi scout(int q, int b) {
	if (q == 10) {
		for (int l = 0; l < L; l++) {
			vi ii;
			for (int i = 0; i < N; i++)
				if ((i >> l & 1) != 0)
					ii.push_back(i + 1);
			send(ii);
		}
		vi cc = wait();
		int i = 0;
		for (int l = 0; l < L; l++)
			if (cc[l])
				i |= 1 << l;
		return { i + 1, i + 1 };
	} else if (q == 20) {
		int lower = 0, upper = N;
		while (upper - lower > 1) {
			int m = (lower + upper) / 2;
			vi ii;
			for (int i = lower; i < m; i++)
				ii.push_back(i + 1);
			send(ii);
			if (wait()[0])
				upper = m;
			else
				lower = m;
		}
		int u = lower;
		lower = 0, upper = N + 1;
		while (upper - lower > 1) {
			int m = (lower + upper) / 2;
			vi ii;
			for (int i = lower; i < m; i++)
				if (i != u)
					ii.push_back(i + 1);
			if (ii.size() == 0) {
				lower = m;
				continue;
			}
			send(ii);
			if (wait()[0])
				upper = m;
			else
				lower = m;
		}
		int v = lower;
		if (v == N)
			v = u;
		return { u + 1, v + 1 };
	} else {
		return { -1, -1 };
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
2 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
3 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
4 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
5 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
6 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
7 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
8 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
9 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
10 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
2 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
3 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
4 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
5 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
6 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
7 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
8 Correct 1 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
9 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
10 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
11 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
12 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
13 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
14 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
15 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
16 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
17 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
18 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
19 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
20 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
21 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
22 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
23 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
24 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
25 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
26 Correct 1 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
27 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
28 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
29 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
30 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
31 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
32 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
33 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
34 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
35 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
36 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
37 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
38 Correct 1 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
39 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
40 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
41 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
42 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
43 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
44 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
45 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
46 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
47 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
48 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
49 Correct 0 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
50 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
51 Correct 1 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
52 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
53 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
54 Correct 0 ms 344 KB Correct: 20 robot(s) used, 20 hour(s) passed
55 Correct 1 ms 344 KB Correct: 19 robot(s) used, 19 hour(s) passed
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -