Submission #547991

# Submission time Handle Problem Language Result Execution time Memory
547991 2022-04-12T07:55:15 Z SamNguyen Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
10 ms 2016 KB
#include "Anna.h"
#include <vector>
#include <iostream>
#include <math.h>
using namespace std;

void Anna(int N, vector<char> S) {
	const int MAX_BIT = log2(N - 1);

	char target = 'X';

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

		for (int x = 0; x <= MAX_BIT; x++)
			Send((j >> x) & 1);

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

namespace {
	
}

void Bruno(int N, int L, std::vector<int> A) {
	const int MAX_BIT = log2(N - 1);
	vector<int> check_points = {-1};

	for (int i = 0; i < L; i += MAX_BIT + 1) {
		int x = 0;
		for (int j = 0; j <= MAX_BIT; j++)
			x |= A[i + j] << j;

		check_points.push_back(x);
	}

	check_points.push_back(N);

	for (int i = 0; i < (int)check_points.size(); i++) 
		for (int j = check_points[i] - 1; j > check_points[i - 1]; j--)
			Remove(j);
	
	for (int i : check_points)
		if (i >= 0 and i < N)
			Remove(i);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 520 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 2016 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -