답안 #775124

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
775124 2023-07-06T07:56:23 Z cheat_when_I_was_young Shopping (JOI21_shopping) C++17
10 / 100
79 ms 528 KB
#include "Anna.h"
#include "bits/stdc++.h"
using namespace std;

namespace {

int n, l, r, ans;

}  // namespace

void InitA(int N, int L, int R) {
    ::n = N;
    ::l = L;
    ::r = R;
    for (int i = 0; i < 18; ++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;

namespace {

const int NM = 1e6 + 5;
int n, p[NM], l, cnt, ans = 2e9;

}  // namespace

void InitB(int N, vector<int> P) {
    ::n = N;
    for(int i = 0; i < N; i++) p[i] = P[i];
}

void ReceiveB(bool y) {
    if (y) l |= 1 << cnt;
    ++cnt;
    if (cnt < 18) return;
    for (int i = l; i < n; ++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 2 ms 400 KB Output is correct
3 Correct 1 ms 400 KB Output is correct
4 Correct 0 ms 400 KB Output is correct
5 Correct 0 ms 400 KB Output is correct
6 Correct 9 ms 400 KB Output is correct
7 Correct 6 ms 400 KB Output is correct
8 Correct 6 ms 400 KB Output is correct
9 Correct 1 ms 400 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 6 ms 400 KB Output is correct
14 Correct 8 ms 400 KB Output is correct
15 Correct 6 ms 400 KB Output is correct
16 Correct 5 ms 400 KB Output is correct
17 Correct 9 ms 400 KB Output is correct
18 Correct 7 ms 400 KB Output is correct
19 Correct 4 ms 400 KB Output is correct
20 Correct 9 ms 400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 400 KB Output is correct
2 Correct 2 ms 400 KB Output is correct
3 Correct 1 ms 400 KB Output is correct
4 Correct 0 ms 400 KB Output is correct
5 Correct 0 ms 400 KB Output is correct
6 Correct 9 ms 400 KB Output is correct
7 Correct 6 ms 400 KB Output is correct
8 Correct 6 ms 400 KB Output is correct
9 Correct 1 ms 400 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 6 ms 400 KB Output is correct
14 Correct 8 ms 400 KB Output is correct
15 Correct 6 ms 400 KB Output is correct
16 Correct 5 ms 400 KB Output is correct
17 Correct 9 ms 400 KB Output is correct
18 Correct 7 ms 400 KB Output is correct
19 Correct 4 ms 400 KB Output is correct
20 Correct 9 ms 400 KB Output is correct
21 Correct 43 ms 528 KB Output is correct
22 Correct 26 ms 528 KB Output is correct
23 Correct 55 ms 528 KB Output is correct
24 Correct 20 ms 528 KB Output is correct
25 Correct 46 ms 528 KB Output is correct
26 Correct 56 ms 528 KB Output is correct
27 Correct 30 ms 528 KB Output is correct
28 Correct 55 ms 528 KB Output is correct
29 Correct 79 ms 528 KB Output is correct
30 Correct 24 ms 528 KB Output is correct
31 Correct 30 ms 528 KB Output is correct
32 Correct 49 ms 528 KB Output is correct
33 Correct 28 ms 528 KB Output is correct
34 Correct 41 ms 528 KB Output is correct
35 Correct 6 ms 528 KB Output is correct
36 Correct 14 ms 528 KB Output is correct
37 Correct 71 ms 528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 280 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -