#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
vector<int> ans;
int n = N;
int st = -1, en = -1;
for (int i=0; i<n; i++) {
char u = S[i];
if (u == 'X') {
st = i;
break;
}
}
for (int i=n-1; i>=0; i--) {
if (S[i] == 'Z') {
en = i;
break;
}
}
if (st == -1 || en == -1 || st > en) {
// Send(0);
return;
}
for (int i=st; i<n; i++) {
Send (S[i] == 'Z');
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
if (A.size() == 0) {
for (int i=0; i<N; i++) Remove(i);
return;
}
int sz = A.size();
int base = N - sz;
for (int i=0; i<N-sz; i++) Remove(i);
stack<int> st;
for (int i=0; i<sz; i++) {
if (A[i]) {
while (st.size() > 1) {
int u = st.top();
Remove(u);
st.pop();
}
Remove(base+i);
}
else {
st.push(base+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;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
520 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
516 KB |
Output is correct |
4 |
Correct |
1 ms |
520 KB |
Output is correct |
5 |
Correct |
1 ms |
524 KB |
Output is correct |
6 |
Correct |
1 ms |
520 KB |
Output is correct |
7 |
Correct |
1 ms |
496 KB |
Output is correct |
8 |
Correct |
1 ms |
512 KB |
Output is correct |
9 |
Correct |
0 ms |
520 KB |
Output is correct |
10 |
Correct |
1 ms |
524 KB |
Output is correct |
11 |
Correct |
2 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
53 ms |
8016 KB |
Partially correct |
2 |
Partially correct |
52 ms |
8076 KB |
Partially correct |
3 |
Partially correct |
52 ms |
8072 KB |
Partially correct |
4 |
Partially correct |
52 ms |
8052 KB |
Partially correct |
5 |
Partially correct |
49 ms |
8072 KB |
Partially correct |
6 |
Partially correct |
49 ms |
8100 KB |
Partially correct |
7 |
Partially correct |
53 ms |
8068 KB |
Partially correct |
8 |
Partially correct |
54 ms |
8084 KB |
Partially correct |
9 |
Partially correct |
49 ms |
8052 KB |
Partially correct |
10 |
Partially correct |
57 ms |
8044 KB |
Partially correct |
11 |
Partially correct |
51 ms |
8164 KB |
Partially correct |
12 |
Partially correct |
54 ms |
8092 KB |
Partially correct |
13 |
Partially correct |
46 ms |
8080 KB |
Partially correct |
14 |
Partially correct |
61 ms |
8052 KB |
Partially correct |
15 |
Partially correct |
57 ms |
8212 KB |
Partially correct |
16 |
Partially correct |
60 ms |
8016 KB |
Partially correct |
17 |
Correct |
45 ms |
6736 KB |
Output is correct |
18 |
Correct |
49 ms |
6740 KB |
Output is correct |
19 |
Correct |
44 ms |
6760 KB |
Output is correct |
20 |
Partially correct |
49 ms |
8108 KB |
Partially correct |
21 |
Partially correct |
51 ms |
8132 KB |
Partially correct |
22 |
Partially correct |
50 ms |
8104 KB |
Partially correct |
23 |
Partially correct |
49 ms |
8160 KB |
Partially correct |
24 |
Partially correct |
51 ms |
8076 KB |
Partially correct |
25 |
Correct |
51 ms |
6744 KB |
Output is correct |
26 |
Correct |
43 ms |
6752 KB |
Output is correct |
27 |
Correct |
44 ms |
6816 KB |
Output is correct |
28 |
Correct |
50 ms |
6736 KB |
Output is correct |
29 |
Correct |
46 ms |
6736 KB |
Output is correct |
30 |
Correct |
43 ms |
6708 KB |
Output is correct |
31 |
Correct |
43 ms |
6720 KB |
Output is correct |
32 |
Partially correct |
51 ms |
8120 KB |
Partially correct |
33 |
Partially correct |
57 ms |
8068 KB |
Partially correct |