Submission #440808

#TimeUsernameProblemLanguageResultExecution timeMemory
440808Haruto810198Worm Worries (BOI18_worm)C++17
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define FOR(i, l, r, d) for(int i=(l); i<=(r); i+=(d)) #define szof(x) ((int)(x).size()) #define vi vector<int> #define pii pair<int,int> #define pb push_back #define eb emplace_back #define mkp make_pair const int INF = 2147483647; const int LNF = INF*INF; const int MOD = 1000000007; const int mod = 998244353; //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") int X, Y, Z; int Q; int query(int x, int y, int z){ cout<<"? "<<x<<" "<<y<<" "<<z<<" "<<endl; int ret; cin>>ret; return ret; } int solve_1D(int y, int z){ int xl = 1, xr = X, xml, xmr; while(xl < xr){ xml = (xl + xr) / 2; xmr = xml + 1; int lval = query(xml, y, z); int rval = query(xmr, y, z); if(lval < rval){ xl = xmr; } else{ xr = xml; } } return xl; } signed main(){ //ios_base::sync_with_stdio(false); //cin.tie(0); //cout.tie(0); cin>>X>>Y>>Z>>Q; int res = solve_1D(1, 1); cout<<"! "<<res<<" 1 1"<<endl; return 0; }
#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...