이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <utility>
#include <cmath>
#include <numeric>
#include <assert.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pb push_back
//#define endl "\n"
#define all(x) x.begin(), x.end()
const int M = 207;
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const double pi = acos(-1);
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
int n, m, k, q, a[M][M], tot;
int ask(int i, int j, int l)
{
if(i == 0 || j == 0 || l == 0 || i > n || j > m || l > k) return 0;
cout << "? " << i << " " << j << " " << l << endl;
int ret;
cin >> ret;
assert(ret != -1);
++tot;
return ret;
}
int main()
{
cout.flush();
cin >> n >> m >> k >> q;
for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) a[i][j] = ask(i, j, 1);
assert(tot <= q);
for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) if(a[i][j] >= a[i + 1][j] && a[i][j] >= a[i - 1][j] && a[i][j] >= a[i][j + 1] && a[i][j] >= a[i][j - 1]){
cout << "! " << i << " " << j << " " << 1 << endl;
return 0;
}
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... |