Submission #921982

# Submission time Handle Problem Language Result Execution time Memory
921982 2024-02-04T15:49:13 Z Darren0724 Shopping (JOI21_shopping) C++17
10 / 100
51 ms 5012 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int n, l, r , idx, ans;
int cnt=0;
const int INF=1e9;
vector<int> v;
}  // namespace

void InitA(int N, int L, int R) {
    n = N;
    l = idx = L;
    r = R;
    for(int i=17;i>=0;i--){
        SendA((l>>i)&1);
    }
}

void ReceiveA(bool x) {
    if(idx<=r&&x){
        ans=idx;
    }
    idx++;
}   

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

namespace {

int n;
vector<int> v(1000000);
int cnt=0;
int l=0;


}  // namespace

void InitB(int N, vector<int> P) {
    v=P;
    n=N;
}

void ReceiveB(bool y) {
    l=l*2+y;
    cnt++;
    if(cnt==18){
        int mn=n+5;;
        while(l<n){
            if(v[l]<mn){
                SendB(1);
                mn=v[l];
            }
            else{
                SendB(0);
            }
            l++;
        }
    }
}

Compilation message

Anna.cpp:8:5: warning: '{anonymous}::cnt' defined but not used [-Wunused-variable]
    8 | int cnt=0;
      |     ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4504 KB Output is correct
2 Correct 1 ms 4504 KB Output is correct
3 Correct 1 ms 4504 KB Output is correct
4 Correct 2 ms 4504 KB Output is correct
5 Correct 1 ms 4512 KB Output is correct
6 Correct 5 ms 4504 KB Output is correct
7 Correct 4 ms 4504 KB Output is correct
8 Correct 4 ms 4504 KB Output is correct
9 Correct 2 ms 4504 KB Output is correct
10 Correct 4 ms 4504 KB Output is correct
11 Correct 7 ms 4504 KB Output is correct
12 Correct 3 ms 4504 KB Output is correct
13 Correct 3 ms 4504 KB Output is correct
14 Correct 4 ms 4504 KB Output is correct
15 Correct 3 ms 4504 KB Output is correct
16 Correct 5 ms 4504 KB Output is correct
17 Correct 6 ms 4504 KB Output is correct
18 Correct 5 ms 4504 KB Output is correct
19 Correct 4 ms 4504 KB Output is correct
20 Correct 5 ms 4504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4504 KB Output is correct
2 Correct 1 ms 4504 KB Output is correct
3 Correct 1 ms 4504 KB Output is correct
4 Correct 2 ms 4504 KB Output is correct
5 Correct 1 ms 4512 KB Output is correct
6 Correct 5 ms 4504 KB Output is correct
7 Correct 4 ms 4504 KB Output is correct
8 Correct 4 ms 4504 KB Output is correct
9 Correct 2 ms 4504 KB Output is correct
10 Correct 4 ms 4504 KB Output is correct
11 Correct 7 ms 4504 KB Output is correct
12 Correct 3 ms 4504 KB Output is correct
13 Correct 3 ms 4504 KB Output is correct
14 Correct 4 ms 4504 KB Output is correct
15 Correct 3 ms 4504 KB Output is correct
16 Correct 5 ms 4504 KB Output is correct
17 Correct 6 ms 4504 KB Output is correct
18 Correct 5 ms 4504 KB Output is correct
19 Correct 4 ms 4504 KB Output is correct
20 Correct 5 ms 4504 KB Output is correct
21 Correct 27 ms 4760 KB Output is correct
22 Correct 32 ms 4756 KB Output is correct
23 Correct 24 ms 4760 KB Output is correct
24 Correct 22 ms 4760 KB Output is correct
25 Correct 33 ms 4760 KB Output is correct
26 Correct 45 ms 5012 KB Output is correct
27 Correct 14 ms 4760 KB Output is correct
28 Correct 38 ms 4760 KB Output is correct
29 Correct 51 ms 4760 KB Output is correct
30 Correct 31 ms 4760 KB Output is correct
31 Correct 15 ms 4760 KB Output is correct
32 Correct 28 ms 4760 KB Output is correct
33 Correct 20 ms 4760 KB Output is correct
34 Correct 33 ms 4928 KB Output is correct
35 Correct 4 ms 4760 KB Output is correct
36 Correct 9 ms 4760 KB Output is correct
37 Correct 37 ms 4760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 400 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -