#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[3000000][2][2], 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 () {
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] > n) || (j + c[m] > p) || (l + d[m] > k)) continue;
if((i + b[m] < 1) || (j + c[m] < 1) || (l + d[m] < 1)) continue;
if(!a[b[m] + i][j + c[m]][l + d[m]]) {
int x;
cout <<"? " <<b[m] + i<< " " << j+c[m] << " " << l + d[m];
fflush(stdout);
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] > n) || (j + c[m] > p) || (l + d[m] > k)) continue;
if((i + b[m] < 1) || (j + c[m] < 1) || (l + d[m] < 1)) 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... |