#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
void Anna(int n, vector<char> s){
vector<int> res(n, 0);
bool foundz=0, y=1;
for (int i=n-1; i>=0; --i){
if (!foundz){
if (s[i]=='Z')foundz=1, res[i]=1;
continue;
}
if (y){
if (s[i]=='Y')y=0, res[i]=1;
}
else{
if (s[i]=='X')y=1, res[i]=1;
}
}
for (auto a:res)Send(a);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
void Bruno(int n, int l, vector<int> a){
vector<int> vect;
for (int i=0; i<n; ++i){
if (a[i])vect.pb(i);
else Remove(i);
}
for (int i=vect.size()-2; i>=0; --i)Remove(vect[i]);
if (vect.size())Remove(vect.back());
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |