Submission #1173255

#TimeUsernameProblemLanguageResultExecution timeMemory
1173255SmuggingSpunShopping (JOI21_shopping)C++20
0 / 100
65 ms12356 KiB
#include<bits/stdc++.h>
#include "Anna.h"
using namespace std;
namespace{
    int n, l, r, ans;
    vector<bool>bit;
}
void InitA(int N, int L, int R){
    l = L;
    r = R;
    if((n = N) <= 10000){
        for(int i = 13; i > -1; i--){
            SendA(l >> i & 1);
        }
        return;
    }    
}
void ReceiveA(bool x){
    bit.emplace_back(x);
    if(bit.size() == n - l + 1){
        for(int i = r - l; i > -1; i--){
            if(bit[i]){
                ans = i + l;
                break;
            }
        }
    }
}
int Answer(){
    return ans;
}
#include<bits/stdc++.h>
#include "Bruno.h"
using namespace std;
namespace{
    int n, L = 0, cnt_receive = 0;
    vector<int>a;
}
void InitB(int N, vector<int>P){
    n = N;
    a = P;
}
void ReceiveB(bool y){
    L = (L << 1) + int(y);
    if(++cnt_receive == 14){
        SendB(true);
        for(int i = L + 1, max_i = L; i < n; i++){
            if(a[i] > a[max_i]){
                max_i = i;
                SendB(true);
            }
            else{
                SendB(false);
            }
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...