# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1069561 | boyliguanhan | Ancient Machine (JOI21_ancient_machine) | C++17 | 0 ms | 0 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 "Bruno.h"
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
int pt=1,prvpt=0;
int start=0;
while(start<N&&!A[start])start++;
pt=start+1;
prvpt=start;
while(1){
while(pt<N&&!A[pt])
pt++;
if(pt>=N) break;
for(int i=pt;--i>prvpt;)
Remove(i);
Remove(prvpt=pt);
pt++;
}
for(int i=0;i<=min(start,N-1);i++)
Remove(i);
for(int i=prvpt;++i<N;)
Remove(i);
}
#include "Anna.h"
#include <vector>
void Anna(int N, std::vector<char> S) {
int phase=0;
for(auto i:S) if(phase==0&&i=='X')
phase=1,Send(1);
else Send(phase==1&&i=='Z');
}