Submission #417079

# Submission time Handle Problem Language Result Execution time Memory
417079 2021-06-03T11:33:24 Z shenxy Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
65 ms 8168 KB
#include "Anna.h"
#include <algorithm>
#include <vector>
using namespace std;
void Anna(int N, vector<char> S) {
	int id = 1;
	for (int i = 0; i < N; ++i) {
		if (id && S[i] == 'X') id = 0;
		if (!id && S[i] == 'Z') id = 1;
		Send(id);
	}
}
#include "Bruno.h"
#include <algorithm>
#include <vector>
using namespace std;
void Bruno(int N, int L, vector<int> A) {
	int ptr = 0, l, m;
	while (ptr != L && A[ptr] == 1) Remove(ptr);
	while (ptr != L) {
		l = ptr;
		while (ptr != L && A[ptr] == 0) ++ptr;
		m = ptr;
		while (ptr != L && A[ptr] == 1) ++ptr;
		for (int i = m - 1; i > l; --i) Remove(i);
		for (int i = m; i < ptr; ++i) Remove(i);
		Remove(l);
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 452 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 8168 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -