# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
935484 | SmuggingSpun | Ancient Machine (JOI21_ancient_machine) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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);
}
}