#include <bits/stdc++.h>
using namespace std;
#define int long long int
int n;
bool query(int x, int y) {
if (x < 1 || y < 1 || x > n || y > n) {
return 0;
}
cout << "examine " << x << " " << y << endl;
string s;
cin >> s;
if (s == "true") {
return 1;
} else {
return 0;
}
}
void solve() {
int x0, y0;
cin >> n >> x0 >> y0;
int m = 1;
int x = x0-1, y = y0, lx = x0, ly = y0;
while(query(x, y)) {
lx = x;
m++;
x--;
}
x = x0+1;
while(query(x, y)) {
m++;
x++;
}
x = lx, y = y0-1;
while(query(x, y)) {
ly = y;
y--;
}
x = lx-m;
y = ly-m;
while(query(x, y)) {
lx = x;
ly = y;
x -= m;
y -= m;
}
x = lx-2*m;
y = ly;
while(query(x, y)) {
lx = x;
ly = y;
x -= 2*m;
}
cout << "solution " << lx+5*m/2 << " " << ly+5*m/2 << endl;
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
t = 1;
while(t--) {
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Runtime error |
2 ms |
448 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
452 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |