#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 400005
#define ff first
#define ss second
#define pb push_back
#define sz(s) (int)s.size()
ll n, p, k, answer, q, a[2][2][3000000], x1, x2, x3;
int b[] = {1,-1,0,0,0,0,0};
int c[] = {0,0,1,-1,0,0,0};
int d[] = {0,0,0,0,1,-1,0};
int main () {
ios::sync_with_stdio(0);cin.tie(0);
cin >> n >> p >> k >> q;
x1 = x2 = x3 = 1;
for(int i = 1;i<=n;i++) {
for(int j = 1;j<=p;j++) {
for(int l = 1; l <= k; l++) {
for(int m = 0; m < 7; m++) {
if(i + b[m] == 0 || j + c[m] == 0 || l + d[m] == 0) continue;
if(i + b[m] > n || j + c[m] > p || l + d[m] > k) continue;
if(!a[b[m] + i][j + c[m]][l + d[m]]) {
cout <<"? " <<b[m] + i<< " " << j+c[m] << " " << l + d[m];
fflush(stdout);
int x;
cin >> x;
a[b[m] + i][j + c[m]][l + d[m]] = x;
}
}
ll mx = 0, ans = a[i][j][l];
for(int m = 0; m < 6; m++) {
if(i + b[m] == 0 || j + c[m] == 0 || l + d[m] == 0) continue;
if(i + b[m] > n || j + c[m] > p || l + d[m] > k) continue;
mx = max(mx,a[b[m] + i][j + c[m]][l + d[m]]);
}
if(ans >= mx) {
cout << "! " << i << " " << j << " " << l;
fflush(stdout);
return 0;
}
}
}
}
}
# | 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... |