# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
548014 | SamNguyen | Ancient Machine (JOI21_ancient_machine) | C++17 | 56 ms | 7680 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 <vector>
#include <iostream>
using namespace std;
void Anna(int N, vector<char> S) {
for (int i = 0; i < N; ) {
int j = i;
while (j < N and S[j] == 'Y') {
Send(0);
j++;
}
if (j >= N) break;
Send(1);
i = j + 1;
}
}
#include "Bruno.h"
#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <bitset>
using namespace std;
namespace {
}
void Bruno(int N, int L, std::vector<int> A) {
vector<int> check_points;
for (int i = 0; i < L; i++)
if (A[i])
check_points.push_back(i);
if (check_points.size() & 1)
check_points.pop_back();
for (int i = 0; i < (int)check_points.size(); i += 2) {
for (int j = check_points[i + 1] - 1; j > check_points[i]; j--)
Remove(j);
}
for (int i = 1; i < (int)check_points.size(); i += 2) {
Remove(check_points[i]);
Remove(check_points[i + 1]);
for (int j = check_points[i] + 1; j < check_points[i + 1]; j++)
Remove(j);
}
for (int j = 0; j < check_points.front(); j++)
Remove(j);
for (int j = N - 1; j > check_points.back(); j--)
Remove(j);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |