Submission #935484

# Submission time Handle Problem Language Result Execution time Memory
935484 2024-02-29T08:01:32 Z SmuggingSpun Ancient Machine (JOI21_ancient_machine) C++17
Compilation error
0 ms 0 KB
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
void Anna(int n, vector<char>S){
	int ptr = n - 1;
	vector<int>send(n, 0);
	while(ptr > -1 && S[ptr] != 'Z'){
		Remove(ptr--);
	}
	if(ptr > -1){
		send[ptr--] = 1;
		while(ptr > -1){
			int r_ptr = ptr;
			while(ptr > -1 && S[ptr] != 'X'){
				ptr--;
			}
			send[ptr] = 1;
			while(ptr > -1 && S[ptr] == 'X'){
				ptr--;
			}
			send[ptr] = 1;
		}
	}
	for(int& x : send){
		Send(x);
	}
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
void Bruno(int n, int sz_a, vector<int>A){
	int ptr = n - 1;
	while(ptr > -1 && A[ptr] == 0){
		Remove(ptr--);
	}
	if(ptr > -1){
		int last = ptr--;
		while(ptr > -1){
			int r_ptr = ptr;
			while(ptr > -1 && A[ptr] == 0){
				ptr--;
			}
			for(int i = ptr + 1; i <= r_ptr; i++){
				Remove(i);
			}
			Remove(ptr--);
			while(ptr > -1 && A[ptr] == 0){
				Remove(ptr--);
			}
		}
		Remove(last);
	}
}

Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:8:3: error: 'Remove' was not declared in this scope; did you mean 'remove'?
    8 |   Remove(ptr--);
      |   ^~~~~~
      |   remove
Anna.cpp:13:8: warning: unused variable 'r_ptr' [-Wunused-variable]
   13 |    int r_ptr = ptr;
      |        ^~~~~