#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) x.size())
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << ", " << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint, lint> ii;
void Anna(int n, vector<char> s){
bool hasX = false;
bool hasY = false;
for(int i = 0;i < n;i++){
int res = 0;
if(s[i] == 'X'){
if(hasX) res = 0;
else{
res = 1;
hasX = 1;
}
}
else{
if(hasX){
if(s[i] == 'Y'){
if(hasY) res = 0;
else res = 1, hasY = true;
}
else{
if(hasY) res = 1, hasY = false;
else res = 0;
}
}
else res = 0;
}
Send(res);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) x.size())
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << ", " << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint, lint> ii;
void Bruno(int n, int L, vector<int> A) {
if(sz(A) == 0){
for(int i = 0;i < n;i++) Remove(i);
return;
}
for(int i = 0;i < n;i++){
show(A[i]);
if(A[i] == 0) Remove(i);
}
int X = -1;;
for(int i = 0;i < n;i++){
if(A[i] == 1){
if(X != -1) Remove(i);
else X = i;
}
}
Remove(X);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
484 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
2 ms |
496 KB |
Output is correct |
4 |
Correct |
2 ms |
484 KB |
Output is correct |
5 |
Incorrect |
2 ms |
488 KB |
Wrong Answer [6] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
782 ms |
8560 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |