Submission #935494

# Submission time Handle Problem Language Result Execution time Memory
935494 2024-02-29T08:05:04 Z SmuggingSpun Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
48 ms 8088 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--;
			}
			if(ptr > -1){
				send[ptr] = 1;
				while(ptr > -1 && S[ptr] == 'X'){
					ptr--;
				}
				if(ptr > -1){
					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 Correct 0 ms 780 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Incorrect 0 ms 792 KB Wrong Answer [6]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 8088 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -