이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, x0, y0;
cin >> n;
cin >> x0 >> y0;
int lr = x0, hr = n;
while(lr<hr){
int m = lr+(hr-lr+1)/2;
int m1 = lr+(m-lr)/2, m2 = lr+(m-lr)/4;
cout << "examine " << m << " " << y0 << endl;
string s; cin >> s;
if(s == "false"){
hr = m-1;
continue;
}
cout << "examine " << m1 << " " << y0 << endl;
string s1; cin >> s1;
if(s1 == "false"){
hr = m-1;
continue;
}
cout << "examine " << m2 << " " << y0 << endl;
string s2; cin >> s2;
if(s2 == "false"){
hr = m-1;
continue;
}
else{
lr = m;
}
}
int ll = 1, hl = x0;
while(ll<hl){
int m = hl-(hl-ll+1)/2;
int m1 = hl-(hl-m)/2, m2 = hl-(hl-m)/4;
cout << "examine " << m << " " << y0 << endl;
string s; cin >> s;
if(s == "false"){
ll = m+1;
continue;
}
cout << "examine " << m1 << " " << y0 << endl;
string s1; cin >> s1;
if(s1 == "false"){
ll = m+1;
continue;
}
cout << "examine " << m2 << " " << y0 << endl;
string s2; cin >> s2;
if(s2 == "false"){
ll = m+1;
continue;
}
else{
hl = m;
}
}
int lt = y0, ht = n;
while(lt<ht){
int m = lt+(ht-lt+1)/2;
int m1 = lt+(m-lt)/2, m2 = lt+(m-lt)/4;
cout << "examine " << x0 << " " << m << endl;
string s; cin >> s;
if(s == "false"){
ht = m-1;
continue;
}
cout << "examine " << x0 << " " << m1 << endl;
string s1; cin >> s1;
if(s1 == "false"){
ht = m-1;
continue;
}
cout << "examine " << x0 << " " << m2 << endl;
string s2; cin >> s2;
if(s2 == "false"){
ht = m-1;
continue;
}
else{
lt = m;
}
}
int lx = lr, rx = hl, ty = lt, by = ty-lx+rx;
int m = lx-rx+1;
int x1 = (lx+rx)/2, y1 = (ty+by)/2;
long long largeleft = x1+2*m, largeright = x1-2*m, largetop = y1+2*m, largebottom = y1-2*m;
while(largetop <= n){
cout << "examine " << x1 << " " << largetop << endl;
string s; cin >> s;
if(s == "false"){
break;
}
else largetop += 2*m;
}
while(largeleft <= n){
cout << "examine " << largeleft << " " << y1 << endl;
string s; cin >> s;
if(s=="false") break;
else largeleft += 2*m;
}
while(largeright >= 1){
cout << "examine " << largeright << " " << y1 << endl;
string s; cin >> s;
if(s=="false") break;
else largeright -= 2*m;
}
while(largebottom >= 1){
cout << "examine " << x1 << " " << largebottom << endl;
string s; cin >> s;
if(s == "false") break;
else largebottom -= 2*m;
}
cout << "solution " << (largeright+largeleft)/2 << " " << (largetop+largebottom)/2 << endl;
}
# | 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... |
# | 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... |