이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define N 200005
using namespace std;
map<vector<int>,int> mp;
int cnt = 0;
int ask(int x,int y,int z){
if(mp[{x,y,z}])return mp[{x,y,z}];
cout << "? " << x << " " << y << " " << z << endl;
assert(++cnt <= 40);
int ret;
cin >> ret;
return mp[{x,y,z}] = ret;
}
void ans(int x,int y,int z){
cout << "! " << x << " " << y << " " << z << endl;
exit(0);
}
void solve(){
int n,m,k,q;
cin >> n >> m >> k >> q;
if(m == 1 && k == 1){
int l = 1,r = n;
while(l < r){
int m = (l + r)/2;
if(ask(m,1,1) > ask(m+1,1,1)){
r = m;
}
else l = m+1;
}
ans(l,1,1);
}
}
int32_t main(){
int t=1;
//cin>>t;
while(t--){
solve();
}
#ifdef Local
cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds ";
#endif
}
# | 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... |