# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
710406 | lmqzzz | Ancient Machine (JOI21_ancient_machine) | C++17 | 66 ms | 8232 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 last = -1;
for (int i = 0; i < N; i++) {
if (last == -1 && S[i] == 'X') {
Send(1);
last = i;
} else if (last == -1) {
Send(0);
} else if (S[i] == 'Z') {
Send(1);
} else {
Send(0);
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
int last = -1;
for (int i = 0; i < L; i++) {
if (A[i]) {
if (last != -1) {
for (int j = i - 1; j > last; j--) Remove(j);
Remove(i);
}
last = i;
}
}
int i = 0;
while (i < N && A[i] == 0) Remove(i++);
if (i < N) Remove(i);
i = last + 1;
while (i < N) Remove(i++);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |