# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800047 | Sohsoh84 | Ancient Machine (JOI21_ancient_machine) | C++17 | 43 ms | 8180 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;
namespace {
int variable_example = 0;
}
void Anna(int N, vector<char> S) {
variable_example++;
bool flag = true;
vector<int> A;
for (int i = 0; i < N; i++) {
A.push_back((S[i] == 'Z'));
}
int ind = 0;
while (S[ind] != 'X' && ind < N) ind++;
if (ind == N) return;
/*
for (int i = N - 2; i >= 0; i--)
if (A[i] == 1 && A[i + 1] == 1)
A[i] = 0;
*/
for (int i = 0; i <= ind; i++)
A[i] = 0;
if (ind) A[ind - 1] = 1;
for (int e : A)
Send(e);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
if (!L) {
for (int i = 0; i < N; i++)
Remove(i);
return;
}
stack<int> st;
for (int i = 0; i < L; i++) {
if (A[i]) {
while (st.size() > 1) {
Remove(st.top());
st.pop();
}
Remove(i);
} else st.push(i);
}
while (!st.empty()) {
Remove(st.top());
st.pop();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |