제출 #548017

#제출 시각아이디문제언어결과실행 시간메모리
548017SamNguyenAncient Machine (JOI21_ancient_machine)C++17
70 / 100
67 ms8152 KiB
#include "Anna.h"
#include <vector>
#include <iostream>
using namespace std;

void Anna(int N, vector<char> S) {
	char target = 'X';

	for (int i = 0; i < N; target = 'Z') {
		int j = i;	
		while (j < N and S[j] != target) {
			Send(0);
			j++;
		}
		if (j >= N) break;

		Send(1);
		i = j + 1;
	}
}
#include "Bruno.h"
#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <bitset>
using namespace std;

namespace {
	
}

void Bruno(int N, int L, std::vector<int> A) {
	vector<int> check_points;

	for (int i = 0; i < L; i++) 
		if (A[i])
			check_points.push_back(i);

	check_points.push_back(N);

	for (int i = 1; i < (int)check_points.size(); i++) {
		for (int j = check_points[i] - 1; j > check_points[i - 1]; j--)
			Remove(j);

		if (check_points[i] < N)
			Remove(check_points[i]);
	}

	for (int j = 0; j <= check_points.front(); j++)
		if (j < N)
			Remove(j);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...