# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
928558 | denniskim | Ancient Machine (JOI21_ancient_machine) | C++17 | 53 ms | 8632 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 X = -1;
}
void Anna(int N, std::vector<char> S)
{
X = -1;
for(int i = 0 ; i < N ; i++)
{
int ff = 0;
if(S[i] == 'X')
{
if(X == -1)
ff = 1, X = i;
}
else if(S[i] == 'Z')
{
if(X != -1)
{
if(i == N - 1 || S[i + 1] != 'Z')
ff = 1;
}
}
Send(ff);
}
}
#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)
{
std::vector<int> vv;
for(int i = 0 ; i < L ; i++)
{
if(A[i] == 1)
vv.push_back(i);
}
if((int)vv.size() <= 1)
{
for(int i = 0 ; i < N ; i++)
Remove(i);
return;
}
int siz = (int)vv.size();
for(int i = 0 ; i < vv[0] ; i++)
Remove(i);
for(int i = vv[siz - 1] + 1 ; i < N ; i++)
Remove(i);
for(int i = 1 ; i < (int)vv.size() ; i++)
{
for(int j = vv[i] - 1 ; j > vv[i - 1] ; j--)
Remove(j);
Remove(vv[i]);
}
Remove(vv[0]);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |