Submission #921982

#TimeUsernameProblemLanguageResultExecution timeMemory
921982Darren0724Shopping (JOI21_shopping)C++17
10 / 100
51 ms5012 KiB
#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 (stderr)

Anna.cpp:8:5: warning: '{anonymous}::cnt' defined but not used [-Wunused-variable]
    8 | int cnt=0;
      |     ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...