# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
543079 | LittleCube | Ancient Machine (JOI21_ancient_machine) | C++17 | 22 ms | 2804 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>
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
int i = 0;
while(i < N && S[i] != 'X')
{
Send(0);
i++;
}
if(i == N)
return;
Send(1);
i++;
char tar = 'Y';
while(i < N)
{
if(S[i] == tar)
{
Send(1);
tar = (tar == 'Y' ? 'Z' : 'Y');
}
else
Send(0);
i++;
}
}
#include "Bruno.h"
#include <vector>
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
int i = 0, j = 0, x = 0, y = 0, z = 0;
for(; i < N; i++)
if(A[i] == 1)
{
x = i;
for(; j < i; j++)
Remove(j);
j = x + 1;
break;
}
for(; i < N; i++)
{
if(y == 0 && A[i])
y = i;
else if(y && A[i])
{
z = i;
for(; j < y; j++)
Remove(j);
j++;
for(; j < z; j++)
Remove(j);
Remove(y);
Remove(z);
j = z + 1;
}
}
for(; j < N; j++)
Remove(j);
Remove(x);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |