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>
#define int long long
using namespace std;
int INF = 1LL<<30;
int query(int x, int y, int z) {
cout << "? " << x <<" " << y <<" " <<z << endl;
int an; cin >> an;
return an;
}
void answer(int x, int y, int z) {
cout << "! " << x << " " << y << " " << z << endl;
}
int n,m,k,q;
signed main() {
cin >> n >> m >> k >> q;
int l = 1;
int r = n;
while (l<r) {
int m1 = l+(r-l)/3;
int m2 = r-(r-l)/3;
if (query(m1,1,1)<query(m2,1,1)) {
l=m1+1;
r=r;
}
else {
l=l;
r=m2-1;
}
}
answer(l,1,1);
}
# | 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... |