Submission #486957

#TimeUsernameProblemLanguageResultExecution timeMemory
486957FatihSolakWorm Worries (BOI18_worm)C++17
0 / 100
1 ms456 KiB
#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 <= 38); 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...