#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
for (auto u : S) {
if (u == 'X') Send (0), Send (0);
else if (u == 'Y') Send (0), Send(1);
else Send (1), Send(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
string s;
int n = N;
for (int i=0; i<2*n; i+=2) {
if (s[i] == 0 && s[i+1] == 0) s.push_back('X');
else if (s[i] == 0 && s[i+1] == 1) s.push_back('Y');
else s.push_back('Z');
}
int l = -1, r = -1;
for (int i=0; i<n; i++) {
if (s[i] == 'X') {
l = i;
break;
}
}
for (int i=n-1; i>=0; i--) {
if (s[i] == 'Z') {
r = i;
break;
}
}
if (l == -1 || r == -1) {
for (int i=0; i<n; i++) Remove(i);
return;
}
for (int i=0; i<l; i++) Remove(i);
for (int i=r+1; i<n; i++) Remove(i);
stack<int> st;
st.push(l);
for (int i=l+1; i<=r; i++) {
int u = st.top();
if (s[i] == s[u]) {
Remove(i);
continue;
}
if (s[i] == 'Z') {
while (st.size() > 1) {
int u = st.top();
Remove(u);
st.pop();
}
}
else st.push(i);
}
while (st.size()) {
int u = st.top();
Remove(u);
st.pop();
}
}
Compilation message
Anna.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
6 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
Bruno.cpp:8:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
8 | int FunctionExample(int P) { return 1 - P; }
| ^~~~~~~~~~~~~~~
Bruno.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
6 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
524 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
68 ms |
9564 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |