Submission #935491

# Submission time Handle Problem Language Result Execution time Memory
935491 2024-02-29T08:03:46 Z SmuggingSpun Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
49 ms 8168 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'){
		ptr--;
	}
	if(ptr > -1){
		send[ptr--] = 1;
		while(ptr > -1){
			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);
			}
			if(ptr > -1){
				Remove(ptr--);
				while(ptr > -1 && A[ptr] == 0){
					Remove(ptr--);
				}
			}
		}
		Remove(last);
	}
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 8168 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -