Submission #800037

# Submission time Handle Problem Language Result Execution time Memory
800037 2023-08-01T09:32:35 Z Sohsoh84 Ancient Machine (JOI21_ancient_machine) C++17
Compilation error
0 ms 0 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
	int variable_example = 0;
}

void Anna(int N, vector<char> S) {
	variable_example++;
	bool flag = true;
	vector<int> A;

	for (int i = 0; i < N; i++) {
		A.push_back((S[i] == 'Z'));
	}

	int ind = 0;
	while (S[ind] != 'X' && ind < N) ind++;

	if (ind == N) return;

	for (int i = N - 2; i >= 0; i--)
		if (A[i] == 1 && A[i + 1] == 1)
			A[i] = 0;

	for (int i = 0; i <= ind; i++)
		A[i] = 0;

	A[ind] = 1;

	for (int e : A)
		Send(e);
}





    

Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:12:7: warning: unused variable 'flag' [-Wunused-variable]
   12 |  bool flag = true;
      |       ^~~~

/usr/bin/ld: /tmp/ccni69hz.o: in function `main':
grader_bruno.cpp:(.text.startup+0x24d): undefined reference to `Bruno(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status