#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
}
void Anna(int N, vector<char> S) {
for (int i = 0; i < N; i++) {
if (S[i] == 'X') Send(0), Send(0);
else if (S[i] == 'Y') Send(0), Send(1);
else Send(1), Send(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
const int MAXN = 1e6 + 10;
vector<int> A;
bool B[MAXN];
}
inline void remove(int ind) {
B[ind] = true;
Remove(ind);
}
void Bruno(int N, int L, vector<int> INP) {
for (int i = 0; i < N; i++) {
int ax = INP[i << 1], ay = INP[i << 1 | 1];
if (ax == 0 && ay == 0) A.push_back(0);
else if (ax == 0) A.push_back(1);
else A.push_back(2);
}
stack<int> st;
for (int i = 0; i < N; i++) {
if (A[i] != 0 && st.empty()) {
remove(i);
} else {
if (A[i] == 2) {
while (int(st.size()) > 1) remove(st.top()), st.pop();
remove(i);
} else {
st.push(i);
}
}
}
for (int i = 0; i < N; i++)
if (!B[i])
remove(i);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
508 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Correct |
0 ms |
508 KB |
Output is correct |
4 |
Correct |
0 ms |
508 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
0 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
508 KB |
Output is correct |
8 |
Correct |
0 ms |
508 KB |
Output is correct |
9 |
Correct |
1 ms |
516 KB |
Output is correct |
10 |
Correct |
0 ms |
516 KB |
Output is correct |
11 |
Correct |
0 ms |
512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
61 ms |
9484 KB |
Partially correct |
2 |
Partially correct |
54 ms |
9508 KB |
Partially correct |
3 |
Partially correct |
57 ms |
9480 KB |
Partially correct |
4 |
Partially correct |
54 ms |
9476 KB |
Partially correct |
5 |
Partially correct |
54 ms |
9532 KB |
Partially correct |
6 |
Partially correct |
65 ms |
9636 KB |
Partially correct |
7 |
Partially correct |
55 ms |
9532 KB |
Partially correct |
8 |
Partially correct |
67 ms |
9640 KB |
Partially correct |
9 |
Partially correct |
60 ms |
9488 KB |
Partially correct |
10 |
Partially correct |
54 ms |
9556 KB |
Partially correct |
11 |
Partially correct |
59 ms |
9500 KB |
Partially correct |
12 |
Partially correct |
54 ms |
9572 KB |
Partially correct |
13 |
Partially correct |
57 ms |
9584 KB |
Partially correct |
14 |
Partially correct |
61 ms |
9496 KB |
Partially correct |
15 |
Partially correct |
55 ms |
9624 KB |
Partially correct |
16 |
Partially correct |
59 ms |
9568 KB |
Partially correct |
17 |
Partially correct |
59 ms |
9924 KB |
Partially correct |
18 |
Partially correct |
60 ms |
9552 KB |
Partially correct |
19 |
Partially correct |
59 ms |
9540 KB |
Partially correct |
20 |
Partially correct |
53 ms |
9624 KB |
Partially correct |
21 |
Partially correct |
54 ms |
9536 KB |
Partially correct |
22 |
Partially correct |
52 ms |
9548 KB |
Partially correct |
23 |
Partially correct |
53 ms |
9508 KB |
Partially correct |
24 |
Partially correct |
54 ms |
9552 KB |
Partially correct |
25 |
Partially correct |
58 ms |
9552 KB |
Partially correct |
26 |
Partially correct |
59 ms |
9860 KB |
Partially correct |
27 |
Partially correct |
60 ms |
9544 KB |
Partially correct |
28 |
Partially correct |
59 ms |
9956 KB |
Partially correct |
29 |
Partially correct |
59 ms |
9508 KB |
Partially correct |
30 |
Partially correct |
60 ms |
9580 KB |
Partially correct |
31 |
Partially correct |
65 ms |
9536 KB |
Partially correct |
32 |
Partially correct |
55 ms |
9620 KB |
Partially correct |
33 |
Partially correct |
55 ms |
9704 KB |
Partially correct |