Submission #1032805

#TimeUsernameProblemLanguageResultExecution timeMemory
1032805anangoWorm Worries (BOI18_worm)C++17
10 / 100
1 ms412 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int INF = 1LL<<30; int query(int x, int y, int z) { cout << "? " << x <<" " << y <<" " <<z << endl; int an; cin >> an; return an; } void answer(int x, int y, int z) { cout << "! " << x << " " << y << " " << z << endl; } int n,m,k,q; signed main() { cin >> n >> m >> k >> q; int l = 1; int r = n; while (l<r) { int m1 = l+(r-l)/3; int m2 = r-(r-l)/3; if (query(m1,1,1)<query(m2,1,1)) { l=m1+1; r=r; } else { l=l; r=m2-1; } } answer(l,1,1); }
#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...