# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
712601 | tht2005 | Ancient Machine (JOI21_ancient_machine) | C++17 | 92 ms | 10236 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 <vector>
void Anna(int N, std::vector<char> S) {
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(0);
}
else {
Send(1);
}
}
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(1);
}
else {
Send(0);
}
}
}
#include "Bruno.h"
#include <vector>
void Bruno(int N, int L, std::vector<int> A) {
std::vector<int> S(N);
for(int i = 0; i < N; ++i) {
S[i] = (A[i] << 1) | A[N + i];
}
int first_X = 0;
while(first_X < N && S[first_X] > 0) {
++first_X;
}
std::vector<int> stk;
for(int i = 0; i < first_X; ++i) {
Remove(i);
}
for(int i = first_X; i < N; ++i) {
if(S[i] == 1) {
while(!stk.empty() && S[stk.back()] > 0) {
Remove(stk.back());
stk.pop_back();
}
}
else if(S[i] == 2) {
while(!stk.empty() && first_X < stk.back()) {
Remove(stk.back());
stk.pop_back();
}
}
stk.push_back(i);
}
for(int i : stk) {
Remove(i);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |