#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sz size()
#define ff first
#define ss second
#define pb push_back
#define pii pair <ll, ll>
const int N = 2e5 + 5;
ll n, sorag = 0;
ll m = 1;
bool ask (ll jj, ll kk) {
// if (jj > n or kk > n) return 0;
// if (jj < 1 or kk < 1) return 0;
sorag++;
// assert (sorag <= 300 and m <= 100);
cout << flush;
cout << "examine " << jj << " " << kk << endl;
string s;
cin >> s;
if (s[0] == 't') return 1;
return 0;
}
int main () {
// freopen ("input.txt", "r", stdin);
// ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll a, b;
cin >> n >> a >> b;
ll l = a, r = a;
while (l > 1) {
if (!ask(l - 1, b)) {
break;
}
l--;
m++;
}
while (r < n) {
if (!ask(r + 1, b)) break;
r++;
m++;
}
ll l1 = b, r1 = b;
while (l1 > 1) {
if (!ask(a, l1 - 1)) {
break;
}
l1--;
}
while (r1 < n) {
if (!ask(a, r1 + 1)) break;
r1++;
}
// return 0;
ll x = l, y = r1;
while (x > 2LL*m) {
if (!ask(x - 2LL* m, y)) break;
x -= 2LL*m;
}
if (x > m and y + m <= n) {
if (ask(x - m, y + m)) {
x -= m;
y += m;
}
}
while (y + 2 * m <= n) {
if (!ask (x, y + 2LL * m)) {
break;
}
y += 2*m;
}
ll jog1 = (x + 2 * m) + (m / 2LL), jog2 = (y - (2LL * m)) - (m / 2);
cout << "solution " << jog1 << " " << jog2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
356 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
356 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
348 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |