Submission #708950

# Submission time Handle Problem Language Result Execution time Memory
708950 2023-03-12T20:42:40 Z kostia244 Shopping (JOI21_shopping) C++17
10 / 100
88 ms 616 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int N, L, R;
int best, pos;

}  // namespace

void InitA(int N, int L, int R) {
    ::N = N;
    ::L = L;
    ::R = R;
    best = pos = L;
    for(int i = 0; i < 18; i++) 
        SendA((L >> i) & 1);
}

void ReceiveA(bool x) {
    ++pos;
    if(pos <= R && x)
        best = pos;
}

int Answer() {
    return best;
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int n, start, cnt;
vector<int> p;

}  // namespace

void InitB(int N, std::vector<int> P) {
    n = N;
    p = P;
    start = 0;
    cnt = 0;
}

void ReceiveB(bool y) {
    start |= y << cnt++;
    if(cnt == 18) {
        int mn = p[start];
        for(int i = start + 1; i < n; i++) {
            SendB(mn > p[i]);
            mn = min(mn, p[i]);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 400 KB Output is correct
2 Correct 1 ms 400 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 1 ms 400 KB Output is correct
5 Correct 2 ms 400 KB Output is correct
6 Correct 9 ms 408 KB Output is correct
7 Correct 8 ms 400 KB Output is correct
8 Correct 5 ms 400 KB Output is correct
9 Correct 3 ms 400 KB Output is correct
10 Correct 8 ms 400 KB Output is correct
11 Correct 9 ms 400 KB Output is correct
12 Correct 5 ms 400 KB Output is correct
13 Correct 7 ms 400 KB Output is correct
14 Correct 8 ms 400 KB Output is correct
15 Correct 5 ms 400 KB Output is correct
16 Correct 8 ms 400 KB Output is correct
17 Correct 9 ms 400 KB Output is correct
18 Correct 6 ms 400 KB Output is correct
19 Correct 6 ms 400 KB Output is correct
20 Correct 9 ms 400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 400 KB Output is correct
2 Correct 1 ms 400 KB Output is correct
3 Correct 2 ms 456 KB Output is correct
4 Correct 1 ms 400 KB Output is correct
5 Correct 2 ms 400 KB Output is correct
6 Correct 9 ms 408 KB Output is correct
7 Correct 8 ms 400 KB Output is correct
8 Correct 5 ms 400 KB Output is correct
9 Correct 3 ms 400 KB Output is correct
10 Correct 8 ms 400 KB Output is correct
11 Correct 9 ms 400 KB Output is correct
12 Correct 5 ms 400 KB Output is correct
13 Correct 7 ms 400 KB Output is correct
14 Correct 8 ms 400 KB Output is correct
15 Correct 5 ms 400 KB Output is correct
16 Correct 8 ms 400 KB Output is correct
17 Correct 9 ms 400 KB Output is correct
18 Correct 6 ms 400 KB Output is correct
19 Correct 6 ms 400 KB Output is correct
20 Correct 9 ms 400 KB Output is correct
21 Correct 63 ms 584 KB Output is correct
22 Correct 64 ms 584 KB Output is correct
23 Correct 58 ms 528 KB Output is correct
24 Correct 37 ms 528 KB Output is correct
25 Correct 47 ms 528 KB Output is correct
26 Correct 88 ms 528 KB Output is correct
27 Correct 37 ms 592 KB Output is correct
28 Correct 72 ms 588 KB Output is correct
29 Correct 68 ms 588 KB Output is correct
30 Correct 74 ms 592 KB Output is correct
31 Correct 33 ms 612 KB Output is correct
32 Correct 55 ms 616 KB Output is correct
33 Correct 27 ms 528 KB Output is correct
34 Correct 65 ms 584 KB Output is correct
35 Correct 8 ms 528 KB Output is correct
36 Correct 16 ms 520 KB Output is correct
37 Correct 70 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 272 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -