#include "Anna.h"
#include "bits/stdc++.h"
using namespace std;
int n, l, r, ans;
void InitA(int N, int L, int R) {
n = N;
l = L;
r = R;
int st, en;
if (n < (1<<19)) {
st = 0;
en = 17;
} else {
l -= l % 4;
st = 2;
en = 19;
}
for (int i = st; i <= en; ++i) SendA((l >> i) & 1);
}
void ReceiveA(bool x) {
if (l <= r && x) ans = l;
++l;
}
int Answer() {
return ans;
}
#include "Bruno.h"
#include "bits/stdc++.h"
using namespace std;
int n, l, cnt, stop = 18, ans = 2e9;
vector<int> p;
void InitB(int N, vector<int> P) {
n = N;
p = P;
if (n >= (1<<19)) {
cnt = 2;
stop = 20;
}
}
void ReceiveB(bool y) {
if (y) l |= 1 << cnt;
++cnt;
if (cnt < stop) return;
for (int i = l; i < min(n, l + 10000); ++i) {
if (ans <= p[i]) {
SendB(0);
continue;
}
ans = p[i];
SendB(1);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
400 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
0 ms |
400 KB |
Output is correct |
4 |
Correct |
2 ms |
400 KB |
Output is correct |
5 |
Correct |
1 ms |
400 KB |
Output is correct |
6 |
Correct |
9 ms |
400 KB |
Output is correct |
7 |
Correct |
9 ms |
400 KB |
Output is correct |
8 |
Correct |
5 ms |
400 KB |
Output is correct |
9 |
Correct |
2 ms |
456 KB |
Output is correct |
10 |
Correct |
7 ms |
400 KB |
Output is correct |
11 |
Correct |
8 ms |
400 KB |
Output is correct |
12 |
Correct |
5 ms |
400 KB |
Output is correct |
13 |
Correct |
3 ms |
400 KB |
Output is correct |
14 |
Correct |
9 ms |
400 KB |
Output is correct |
15 |
Correct |
6 ms |
400 KB |
Output is correct |
16 |
Correct |
4 ms |
400 KB |
Output is correct |
17 |
Correct |
9 ms |
400 KB |
Output is correct |
18 |
Correct |
3 ms |
400 KB |
Output is correct |
19 |
Correct |
4 ms |
420 KB |
Output is correct |
20 |
Correct |
8 ms |
444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
400 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
0 ms |
400 KB |
Output is correct |
4 |
Correct |
2 ms |
400 KB |
Output is correct |
5 |
Correct |
1 ms |
400 KB |
Output is correct |
6 |
Correct |
9 ms |
400 KB |
Output is correct |
7 |
Correct |
9 ms |
400 KB |
Output is correct |
8 |
Correct |
5 ms |
400 KB |
Output is correct |
9 |
Correct |
2 ms |
456 KB |
Output is correct |
10 |
Correct |
7 ms |
400 KB |
Output is correct |
11 |
Correct |
8 ms |
400 KB |
Output is correct |
12 |
Correct |
5 ms |
400 KB |
Output is correct |
13 |
Correct |
3 ms |
400 KB |
Output is correct |
14 |
Correct |
9 ms |
400 KB |
Output is correct |
15 |
Correct |
6 ms |
400 KB |
Output is correct |
16 |
Correct |
4 ms |
400 KB |
Output is correct |
17 |
Correct |
9 ms |
400 KB |
Output is correct |
18 |
Correct |
3 ms |
400 KB |
Output is correct |
19 |
Correct |
4 ms |
420 KB |
Output is correct |
20 |
Correct |
8 ms |
444 KB |
Output is correct |
21 |
Correct |
45 ms |
584 KB |
Output is correct |
22 |
Correct |
52 ms |
596 KB |
Output is correct |
23 |
Correct |
55 ms |
592 KB |
Output is correct |
24 |
Correct |
26 ms |
528 KB |
Output is correct |
25 |
Correct |
43 ms |
592 KB |
Output is correct |
26 |
Correct |
67 ms |
588 KB |
Output is correct |
27 |
Correct |
27 ms |
592 KB |
Output is correct |
28 |
Correct |
59 ms |
528 KB |
Output is correct |
29 |
Correct |
45 ms |
588 KB |
Output is correct |
30 |
Correct |
73 ms |
584 KB |
Output is correct |
31 |
Correct |
34 ms |
592 KB |
Output is correct |
32 |
Correct |
31 ms |
612 KB |
Output is correct |
33 |
Correct |
35 ms |
608 KB |
Output is correct |
34 |
Correct |
62 ms |
592 KB |
Output is correct |
35 |
Correct |
6 ms |
584 KB |
Output is correct |
36 |
Correct |
16 ms |
528 KB |
Output is correct |
37 |
Correct |
66 ms |
592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
151 ms |
12060 KB |
Output is correct |
2 |
Incorrect |
86 ms |
264 KB |
Wrong Answer [2] |
3 |
Halted |
0 ms |
0 KB |
- |