Submission #543079

# Submission time Handle Problem Language Result Execution time Memory
543079 2022-03-29T06:35:32 Z LittleCube Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
22 ms 2804 KB
#include "Anna.h"
#include <vector>

namespace {

int variable_example = 0;

}

void Anna(int N, std::vector<char> S) {
	int i = 0;
	while(i < N && S[i] != 'X')
	{
		Send(0);
		i++;
	}
	if(i == N)
		return;
	Send(1);
	i++;
	char tar = 'Y';
	while(i < N)
	{
		if(S[i] == tar)
		{
			Send(1);
			tar = (tar == 'Y' ? 'Z' : 'Y');
		}
		else 
			Send(0);
		i++;
	}
}
#include "Bruno.h"
#include <vector>

namespace {

int variable_example = 0;

int FunctionExample(int P) { return 1 - P; }

}  // namespace

void Bruno(int N, int L, std::vector<int> A) {
  	int i = 0, j = 0, x = 0, y = 0, z = 0;
	for(; i < N; i++)
		if(A[i] == 1)
		{
			x = i;
			for(; j < i; j++)
				Remove(j);
			j = x + 1;
			break;
		}
	for(; i < N; i++)
	{
		if(y == 0 && A[i])
		   	y = i;
		else if(y && A[i])
		{
			z = i;
			for(; j < y; j++)
				Remove(j);
			j++;
			for(; j < z; j++)
				Remove(j);
			Remove(y);
			Remove(z);
			j = z + 1;
		}	
	}
	for(; j < N; j++)
		Remove(j);
	Remove(x);
}

Compilation message

Anna.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~

Bruno.cpp:8:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
    8 | int FunctionExample(int P) { return 1 - P; }
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 524 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 2804 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -