This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |