이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
using namespace std;
namespace {
int L, R;
vector<bool> minima;
} // namespace
void InitA(int N, int L, int R) {
::L = L;
::R = R;
for(int bit=0;bit<18;bit++)SendA(L&(1<<bit));
}
void ReceiveA(bool x) {
minima.emplace_back(x);
}
int Answer() {
int last = 0;
for(int i=0;i<=R-L;i++){
if(minima[i])last=i;
}
return L+last;
}
#include "Bruno.h"
#include <vector>
using namespace std;
namespace {
vector<int> P;
int N;
int cnt;
int L;
} // namespace
void InitB(int N, std::vector<int> P) {
::N = N;
::P = P;
}
void ReceiveB(bool y) {
if(y)L|=1<<cnt;
cnt++;
if(cnt==18){
int currmin = 1e9;
for(int i=L;i<N;i++){
if(currmin>P[i]){
SendB(true);
currmin = P[i];
} else SendB(false);
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |