# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
504067 | ld_minh4354 | Ancient Machine (JOI21_ancient_machine) | C++17 | 66 ms | 8592 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) {
bool ok;
vector<int> v(N,0);
ok=0;
for (int i=0;i<N;i++) if (S[i]=='X' and !ok)
{
v[i]=1;ok=1;
}
else if (S[i]=='Z' and ok) v[i]=1;
for (int i=0;i<N;i++) Send(v[i]);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L,std::vector<int> A) {
int p=-1,pos;
bool ok;
for (int i=0;i<N;i++)
if (A[i]==0) Remove(i);else
{
p=i;break;
}
pos=p;
if (p==-1) return;
do
{
ok=0;
for (int i=p+1;i<N;i++) if (A[i]==1)
{
ok=1;
for (int j=i-1;j>p;j--) Remove(j);
Remove(i);
p=i;
}
}
while (ok);
for (int i=p+1;i<N;i++) Remove(i);
Remove(pos);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |