# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
935479 | SmuggingSpun | Ancient Machine (JOI21_ancient_machine) | C++17 | 30 ms | 4620 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){
for(char& c : S){
if(c == 'X'){
Send(0);
Send(0);
}
else if(c == 'Y'){
Send(1);
Send(0);
}
else{
Send(0);
Send(1);
}
}
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
void Bruno(int n, int sz_a, vector<int>A){
const int X = 0, Y = 1, Z = 2;
vector<int>a(n);
for(int i = 0; i < sz_a; i += 2){
a[i >> 1] = A[i] + (A[i + 1] << 1);
}
int ptr = n - 1;
while(ptr > -1 && a[ptr] != Z){
Remove(ptr-- + 1);
}
if(ptr > -1){
int last = ptr--;
while(ptr > -1){
int r_ptr = ptr;
while(ptr > -1 && a[ptr] != X){
ptr--;
}
if(ptr > -1){
for(int i = ptr + 1; i <= r_ptr; i++){
Remove(i + 1);
}
while(ptr > -1 && a[ptr] == X){
Remove(ptr-- + 1);
}
}
}
Remove(last + 1);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |