Submission #861477

#TimeUsernameProblemLanguageResultExecution timeMemory
861477Trisanu_DasWorm Worries (BOI18_worm)C++17
10 / 100
1 ms596 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, m, k, q; cin >> n >> m >> k >> q; int l = 1, r = n + 1; while(l + 1 < r){ int m = (l + r) / 2; int h1, h2; cout << "? " << m - 1 << " 1 1" << endl; cin >> h1; cout << "? " << m << " 1 1" << endl; cin >> h2; if(h2 == -1) exit(0); if(h1 >= h2) r = m; else l = m; } cout << "! " << l << " 1 1" << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...