Submission #931599

# Submission time Handle Problem Language Result Execution time Memory
931599 2024-02-22T06:26:48 Z lamter Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
47 ms 8464 KB
#include "Anna.h"
#include <bits/stdc++.h>

void Anna(int n, std::vector <char> a) {
	bool found = 0;
	for (int i = 0; i < n; i += 1) {
		int bit = 0;

		if (not found and a[i] == 'X') {
			bit = 1;
			found = true;
		}

		if (found and a[i] == 'Z') {
			bit = 1;
		}

		Send(bit);
	}
}
#include "Bruno.h"
#include <bits/stdc++.h>

void Bruno(int n, int l, std::vector <int> a) {
	std::vector <int> posOne;
	for (int i = 0; i < n; i += 1) if (a[i])
		posOne.push_back(i);
	if (posOne.size() < 2) {
		for (int i = 0; i < n; i += 1)
			Remove(i);
		return;
	}
	int x = posOne[0];
	for (int i = 0; i < x; i += 1) {
		Remove(i);
	}
	for (int i = 0; i + 1 < (int) posOne.size(); i += 1) {
		for (int j = posOne[i + 1] - 1; j > posOne[i]; j -= 1)
			Remove(j);
		Remove(posOne[i + 1]);
	}
	for (int j = posOne.back() + 1; j < n; j += 1) {
		Remove(j);
	}
	Remove(x);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 776 KB Output is correct
2 Correct 0 ms 1044 KB Output is correct
3 Correct 0 ms 792 KB Output is correct
4 Correct 0 ms 792 KB Output is correct
5 Correct 0 ms 860 KB Output is correct
6 Correct 0 ms 792 KB Output is correct
7 Correct 0 ms 780 KB Output is correct
8 Correct 0 ms 780 KB Output is correct
9 Correct 0 ms 776 KB Output is correct
10 Correct 0 ms 792 KB Output is correct
11 Correct 1 ms 1180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 7896 KB Partially correct
2 Partially correct 41 ms 7764 KB Partially correct
3 Partially correct 39 ms 7768 KB Partially correct
4 Partially correct 40 ms 7888 KB Partially correct
5 Partially correct 41 ms 7796 KB Partially correct
6 Partially correct 39 ms 7856 KB Partially correct
7 Partially correct 40 ms 7888 KB Partially correct
8 Partially correct 40 ms 7856 KB Partially correct
9 Partially correct 38 ms 7904 KB Partially correct
10 Partially correct 40 ms 7816 KB Partially correct
11 Partially correct 40 ms 7888 KB Partially correct
12 Partially correct 40 ms 7792 KB Partially correct
13 Partially correct 44 ms 8004 KB Partially correct
14 Partially correct 47 ms 7884 KB Partially correct
15 Partially correct 41 ms 7808 KB Partially correct
16 Partially correct 42 ms 7828 KB Partially correct
17 Partially correct 47 ms 7824 KB Partially correct
18 Partially correct 45 ms 8004 KB Partially correct
19 Partially correct 45 ms 8360 KB Partially correct
20 Partially correct 39 ms 8312 KB Partially correct
21 Partially correct 41 ms 8336 KB Partially correct
22 Partially correct 45 ms 8424 KB Partially correct
23 Partially correct 39 ms 8244 KB Partially correct
24 Partially correct 39 ms 8380 KB Partially correct
25 Partially correct 45 ms 8460 KB Partially correct
26 Partially correct 44 ms 8156 KB Partially correct
27 Partially correct 44 ms 8356 KB Partially correct
28 Partially correct 45 ms 8412 KB Partially correct
29 Partially correct 46 ms 8420 KB Partially correct
30 Partially correct 44 ms 8464 KB Partially correct
31 Partially correct 45 ms 8448 KB Partially correct
32 Partially correct 40 ms 8328 KB Partially correct
33 Partially correct 39 ms 8360 KB Partially correct