# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
725042 | piOOE | Ancient Machine (JOI21_ancient_machine) | C++17 | 71 ms | 7900 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, std::vector<char> s) {
int x = find(s.begin(), s.end(), 'X') - s.begin();
int z = n - (find(s.rbegin(), s.rend(), 'Z') - s.rbegin()) - 1;
if (x > z) {
for (int i = 0; i < n; ++i) {
Send(0);
}
} else {
for (int i = 0; i < n; ++i) {
Send(i >= x && i <= z && (i == x || i == z || s[i] == 'Z'));
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
if (A == vector(N, 0)) {
for (int i = 0; i < N; ++i) {
Remove(i);
}
return;
}
int fi = find(A.begin(), A.end(), 1) - A.begin();
for (int i = 0; i < fi; ++i) {
Remove(i);
}
vector<int> stk{fi};
for (int i = fi + 1; i < N; ++i) {
if (A[i]) {
while (stk.size() > 1) {
Remove(stk.back());
stk.pop_back();
}
Remove(i);
} else {
stk.push_back(i);
}
}
for (int x : stk) {
Remove(x);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |