Submission #1007598

#TimeUsernameProblemLanguageResultExecution timeMemory
1007598UnforgettableplShopping (JOI21_shopping)C++17
10 / 100
56 ms1092 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...