답안 #931598

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
931598 2024-02-22T06:24:38 Z lamter Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
51 ms 8552 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) {
	assert(n == l);
	std::vector <int> posOne;
	for (int i = 0; i < n; i += 1) if (a[i])
		posOne.push_back(i);
	assert(posOne.size());
	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);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 788 KB Output is correct
2 Correct 0 ms 792 KB Output is correct
3 Correct 0 ms 780 KB Output is correct
4 Correct 0 ms 784 KB Output is correct
5 Correct 1 ms 796 KB Output is correct
6 Correct 0 ms 796 KB Output is correct
7 Correct 0 ms 784 KB Output is correct
8 Correct 0 ms 788 KB Output is correct
9 Correct 0 ms 796 KB Output is correct
10 Runtime error 0 ms 796 KB Execution killed with signal 6
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 41 ms 7896 KB Partially correct
2 Partially correct 40 ms 7792 KB Partially correct
3 Partially correct 40 ms 8380 KB Partially correct
4 Partially correct 39 ms 8276 KB Partially correct
5 Partially correct 39 ms 8344 KB Partially correct
6 Partially correct 40 ms 8428 KB Partially correct
7 Partially correct 43 ms 8340 KB Partially correct
8 Partially correct 41 ms 8336 KB Partially correct
9 Partially correct 40 ms 8352 KB Partially correct
10 Partially correct 40 ms 8288 KB Partially correct
11 Partially correct 40 ms 8340 KB Partially correct
12 Partially correct 44 ms 8264 KB Partially correct
13 Partially correct 46 ms 8340 KB Partially correct
14 Partially correct 45 ms 8336 KB Partially correct
15 Partially correct 43 ms 8336 KB Partially correct
16 Partially correct 41 ms 8340 KB Partially correct
17 Partially correct 51 ms 8552 KB Partially correct
18 Runtime error 17 ms 4092 KB Execution killed with signal 6
19 Halted 0 ms 0 KB -