#include "Anna.h"
#include "bits/stdc++.h"
using namespace std;
#define ar array
void Anna(int n, vector<char> s) {
int f = -1;
for(int i=0;i<n;i++){
if(s[i] == 'X') { f = i; break; }
}
if(f == -1) return;
vector<int> res(n);
res[f] = 1;
for(int i=f+1;i<n;i++){
if(s[i] == 'Z') res[i] = 1;
}
for(int i=0;i<n;i++) Send(res[i]);
}
#include "Bruno.h"
#include "bits/stdc++.h"
using namespace std;
void Bruno(int n, int l, vector<int> a) {
auto add = [&](int l, int r){
for(int i=l;i<=r;i++) Remove(i);
};
if(!l) { add(0, n - 1); return; }
int f = -1, last = -1;
for(int i=0;i<n;i++){
if(~f){
if(a[i]){
for(int j=i-1;j>last;j--) Remove(j);
Remove(i);
last = i;
}
} else {
if(a[i]) f = i, last = i;
else Remove(i);
}
}
for(int j=n-1;j>last;j--) Remove(j);
Remove(f);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
476 KB |
Output is correct |
2 |
Correct |
1 ms |
552 KB |
Output is correct |
3 |
Correct |
2 ms |
556 KB |
Output is correct |
4 |
Correct |
1 ms |
496 KB |
Output is correct |
5 |
Correct |
1 ms |
488 KB |
Output is correct |
6 |
Correct |
2 ms |
580 KB |
Output is correct |
7 |
Correct |
1 ms |
496 KB |
Output is correct |
8 |
Correct |
1 ms |
564 KB |
Output is correct |
9 |
Correct |
1 ms |
488 KB |
Output is correct |
10 |
Correct |
0 ms |
488 KB |
Output is correct |
11 |
Correct |
1 ms |
420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
76 ms |
8400 KB |
Partially correct |
2 |
Partially correct |
70 ms |
8424 KB |
Partially correct |
3 |
Partially correct |
59 ms |
8360 KB |
Partially correct |
4 |
Partially correct |
67 ms |
8256 KB |
Partially correct |
5 |
Partially correct |
58 ms |
8296 KB |
Partially correct |
6 |
Partially correct |
81 ms |
8372 KB |
Partially correct |
7 |
Partially correct |
58 ms |
8340 KB |
Partially correct |
8 |
Partially correct |
66 ms |
8544 KB |
Partially correct |
9 |
Partially correct |
67 ms |
8460 KB |
Partially correct |
10 |
Partially correct |
60 ms |
8464 KB |
Partially correct |
11 |
Partially correct |
56 ms |
8420 KB |
Partially correct |
12 |
Partially correct |
57 ms |
8464 KB |
Partially correct |
13 |
Partially correct |
73 ms |
8384 KB |
Partially correct |
14 |
Partially correct |
74 ms |
8476 KB |
Partially correct |
15 |
Partially correct |
55 ms |
8356 KB |
Partially correct |
16 |
Partially correct |
64 ms |
8436 KB |
Partially correct |
17 |
Partially correct |
62 ms |
8272 KB |
Partially correct |
18 |
Correct |
46 ms |
6660 KB |
Output is correct |
19 |
Correct |
56 ms |
6656 KB |
Output is correct |
20 |
Partially correct |
57 ms |
8456 KB |
Partially correct |
21 |
Partially correct |
55 ms |
8396 KB |
Partially correct |
22 |
Partially correct |
60 ms |
8296 KB |
Partially correct |
23 |
Partially correct |
62 ms |
8368 KB |
Partially correct |
24 |
Partially correct |
72 ms |
8340 KB |
Partially correct |
25 |
Correct |
46 ms |
6732 KB |
Output is correct |
26 |
Partially correct |
66 ms |
8488 KB |
Partially correct |
27 |
Partially correct |
67 ms |
8440 KB |
Partially correct |
28 |
Partially correct |
64 ms |
8412 KB |
Partially correct |
29 |
Correct |
54 ms |
6732 KB |
Output is correct |
30 |
Partially correct |
63 ms |
8424 KB |
Partially correct |
31 |
Correct |
60 ms |
6664 KB |
Output is correct |
32 |
Partially correct |
52 ms |
8452 KB |
Partially correct |
33 |
Partially correct |
54 ms |
8464 KB |
Partially correct |