#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
for (char c : S)
if (c == 'X'){
Send(0);
Send(0);
}
else{
if (c == '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
string s;
stack<int>pq;
void Bruno(int N, int L, std::vector<int> A) {
for (int i = 0, j = 0; i < N; i++, j += 2){
if (A[j] == 0){
if (A[j + 1] == 0)
s.push_back('x');
else
s.push_back('y');
}
else
s.push_back('z');
}
int l = 0, ptr, r = N - 1;
while (l < N && s[l] != 'x')
Remove(l++);
if (l == N)
return;
while (r >= l && s[r] != 'z')
Remove(r--);
if (l > r)
return;
pq.push(l);
ptr = l + 1;
while (ptr <= r){
if (ptr == r){
if (s[pq.top()] == 'x'){
Remove(pq.top());
pq.pop();
}
while (!pq.empty()){
Remove(pq.top());
pq.pop();
}
Remove(ptr);
break;
}
if (s[ptr] == 'z'){
if (pq.size() > 1 && s[pq.top()] == 'x'){
Remove(pq.top());
pq.pop();
}
while (pq.size() > 1){
Remove(pq.top());
pq.pop();
}
Remove(ptr++);
continue;
}
while (s[ptr] == 'x')
Remove(ptr++);
if (s[ptr] == 'z')
continue;
if (ptr > r){
while (!pq.empty()){
Remove(pq.top());
pq.pop();
}
return;
}
pq.push(ptr++);
while (s[ptr] == 'y')
Remove(ptr++);
if (s[ptr] == 'x')
pq.push(ptr++);
}
}
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;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
508 KB |
Output is correct |
4 |
Correct |
1 ms |
520 KB |
Output is correct |
5 |
Correct |
0 ms |
508 KB |
Output is correct |
6 |
Correct |
1 ms |
508 KB |
Output is correct |
7 |
Correct |
0 ms |
508 KB |
Output is correct |
8 |
Correct |
0 ms |
504 KB |
Output is correct |
9 |
Correct |
0 ms |
516 KB |
Output is correct |
10 |
Correct |
0 ms |
516 KB |
Output is correct |
11 |
Correct |
0 ms |
508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
77 ms |
9140 KB |
Partially correct |
2 |
Partially correct |
74 ms |
9152 KB |
Partially correct |
3 |
Partially correct |
82 ms |
9112 KB |
Partially correct |
4 |
Partially correct |
71 ms |
9196 KB |
Partially correct |
5 |
Partially correct |
69 ms |
9104 KB |
Partially correct |
6 |
Partially correct |
70 ms |
9308 KB |
Partially correct |
7 |
Partially correct |
71 ms |
9148 KB |
Partially correct |
8 |
Partially correct |
69 ms |
9192 KB |
Partially correct |
9 |
Partially correct |
71 ms |
9200 KB |
Partially correct |
10 |
Partially correct |
77 ms |
9176 KB |
Partially correct |
11 |
Partially correct |
72 ms |
9176 KB |
Partially correct |
12 |
Partially correct |
70 ms |
9136 KB |
Partially correct |
13 |
Partially correct |
67 ms |
9320 KB |
Partially correct |
14 |
Partially correct |
87 ms |
9136 KB |
Partially correct |
15 |
Partially correct |
86 ms |
9128 KB |
Partially correct |
16 |
Partially correct |
82 ms |
9204 KB |
Partially correct |
17 |
Partially correct |
90 ms |
9156 KB |
Partially correct |
18 |
Partially correct |
83 ms |
9216 KB |
Partially correct |
19 |
Partially correct |
77 ms |
9148 KB |
Partially correct |
20 |
Partially correct |
70 ms |
9104 KB |
Partially correct |
21 |
Partially correct |
73 ms |
9188 KB |
Partially correct |
22 |
Partially correct |
86 ms |
9200 KB |
Partially correct |
23 |
Partially correct |
68 ms |
9184 KB |
Partially correct |
24 |
Partially correct |
73 ms |
9200 KB |
Partially correct |
25 |
Partially correct |
85 ms |
9128 KB |
Partially correct |
26 |
Partially correct |
81 ms |
9084 KB |
Partially correct |
27 |
Partially correct |
87 ms |
9192 KB |
Partially correct |
28 |
Partially correct |
82 ms |
9124 KB |
Partially correct |
29 |
Partially correct |
82 ms |
9140 KB |
Partially correct |
30 |
Partially correct |
89 ms |
9136 KB |
Partially correct |
31 |
Partially correct |
79 ms |
9052 KB |
Partially correct |
32 |
Partially correct |
71 ms |
9164 KB |
Partially correct |
33 |
Partially correct |
73 ms |
9216 KB |
Partially correct |