#include "Anna.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
namespace {
}
void Anna(int n, vector<char> s){
vector<int> rt(n, 0);
int fx = -1;
for(int i = 0; i < n; i++) if(s[i] == 'X'){
fx = i;
break;
}
if(fx == -1){
for(int x: rt) Send(x);
return;
}
rt[fx] = 1;
for(int i = fx+1; i < n; i++) if(s[i] == 'Z') rt[i] = 1;
for(int x: rt) Send(x);
}
#include "Bruno.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
namespace {
}
void Bruno(int n, int m, vector<int> A){
int fx = -1;
for(int i = 0; i < n; i++) if(A[i] == 1){
fx = i;
break;
}
if(fx == -1){
for(int i = 0; i < n; i++) Remove(i);
return;
}
for(int i = 0; i < fx; i++) Remove(i);
int ls = fx+1;
for(int i = fx+1; i < n; i++){
if(A[i] != 1) continue;
for(int j = ls; j < i; j++) Remove(j);
Remove(i);
ls = i+1;
}
Remove(fx);
for(int i = ls; i < n; i++) Remove(i);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Incorrect |
1 ms |
504 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
61 ms |
8180 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |