# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881275 | GusterGoose27 | Worm Worries (BOI18_worm) | C++17 | 16 ms | 1456 KiB |
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 n, m, k, q;
typedef array<int, 3> arr3;
map<arr3, int> arr;
int query(int i, int j = 0, int k = 0) {
if (i < 0 || i >= n || j < 0 || j >= m || k < 0 || k >= m) return 0;
if (arr.find(arr3({i, j, k})) == arr.end()) {
q--;
assert(q >= 0);
cout << "? " << i+1 << ' ' << j+1 << ' ' << k+1 << endl;
cin >> arr[arr3({i, j, k})];
}
return arr[arr3({i, j, k})];
}
void make_answer(int i, int j = 0, int k = 0) {
cout << "! " << i+1 << ' ' << j+1 << ' ' << k+1 << '\n';
}
void sol1d() {
assert(m == 1); assert(k == 1);
int l = -1, r = n;
while (r > l) {
if (r-l == 1) {
if (query(r) > query(l)) l = r;
# | 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... |