# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947166 | siewjh | Ancient Machine (JOI21_ancient_machine) | C++17 | 62 ms | 8468 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 {
}
void Anna(int N, vector<char> S) {
bool active = 0;
for (int i = 0; i < N; i++){
if (S[i] == 'X'){
Send(!active);
active = 1;
}
else if (S[i] == 'Y') Send(0);
else Send(active);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
} // namespace
void Bruno(int N, int L, vector<int> A) {
int prv = 0, fx = -1;
for (int i = 0; i < N; i++){
if (A[i]){
if (fx == -1){
fx = i; prv = i + 1;
}
else{
for (int j = i - 1; j >= prv; j--) Remove(j);
Remove(i);
prv = i + 1;
}
}
}
for (int i = 0; i <= fx; i++) Remove(i);
for (int i = prv; i < N; i++) Remove(i);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |