Submission #891214

#TimeUsernameProblemLanguageResultExecution timeMemory
891214Dec0DeddLove Polygon (BOI18_polygon)C++14
0 / 100
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<string, string> pii; const int N = 1e6+10; int a[N], n, m, k, q; int ask(int x, int y, int z) { cout<<"? "<<x<<" "<<y<<" "<<z<<endl; int p; cin>>p; return p; } void solve() { cin>>n>>m>>k>>q; assert(m == k && m == 1); int l=1, r=n; while (l <= r) { int md=(l+r)/2; int vl=ask(md, 1, 1), lv=0, rv=0; if (md == 1) rv=ask(md+1, 1, 1); else if (md == n) lv=ask(md-1, 1, 1); else lv=ask(md-1, 1, 1), rv=ask(md+1, 1, 1); if (vl >= lv && vl >= rv) { cout<<"! "<<md<<endl; return; } if (lv > vl) r=md-1; else l=md+1; } assert(false); } int main() { int t=1; while (t--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...