# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
725013 | piOOE | Ancient Machine (JOI21_ancient_machine) | C++17 | 75 ms | 8048 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 type = 0;
for (int i = 0; i < n; ++i) {
int use = 0;
if (s[i] == 'X') {
if (type == 0) {
type |= 1;
use = 1;
}
} else if (s[i] == 'Y') {
if ((type & 1) && !(type & 2)) {
type |= 2;
use = 1;
}
} else if (s[i] == 'Z') {
if ((type & 1) && (type & 2)) {
type ^= 2;
use = 1;
}
}
Send(use);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
for (int i = 0; i < N; ++i) {
if (A[i] == 0) {
Remove(i);
}
}
int fi = find(A.begin(), A.end(), 1) - A.begin();
if (fi != N) {
for (int i = fi + 1; i < N; ++i) {
if (A[i] == 1) {
Remove(i);
}
}
Remove(fi);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |