# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
950749 | andrei_boaca | Ancient Machine (JOI21_ancient_machine) | C++17 | 48 ms | 8488 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>
#include <vector>
using namespace std;
namespace
{
}
void Anna(int N, std::vector<char> S)
{
bool havex=0;
int lastz=-1;
for(int i=N-1;i>=0;i--)
if(S[i]=='Z')
{
lastz=i;
break;
}
for(int i=0;i<N;i++)
{
if(S[i]=='X')
{
if(!havex)
Send(1);
else
Send(0);
havex=1;
continue;
}
if(!havex)
{
Send(0);
continue;
}
if(S[i]=='Z'&&(i==N||S[i+1]=='Y'||i==lastz))
Send(1);
else
Send(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
namespace
{
}
void Bruno(int N, int L, std::vector<int> A)
{
vector<int> vals;
int lft=-1;
for(int i=0;i<A.size();i++)
if(A[i]==1)
{
lft=i;
break;
}
if(lft==-1)
{
for(int i=0;i<N;i++)
Remove(i);
return;
}
for(int i=0;i<lft;i++)
Remove(i);
for(int i=lft+1;i<A.size();i++)
if(A[i]==1)
{
for(int j=i-1;A[j]==0;j--)
Remove(j);
Remove(i);
}
for(int i=L-1;A[i]==0;i--)
Remove(i);
Remove(lft);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |