Submission #708949

# Submission time Handle Problem Language Result Execution time Memory
708949 2023-03-12T20:38:59 Z kostia244 Shopping (JOI21_shopping) C++17
0 / 100
9 ms 404 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 2 ms 400 KB Output is correct
2 Correct 1 ms 404 KB Output is correct
3 Correct 2 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 Incorrect 9 ms 200 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 400 KB Output is correct
2 Correct 1 ms 404 KB Output is correct
3 Correct 2 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 Incorrect 9 ms 200 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 268 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -