Submission #723735

#TimeUsernameProblemLanguageResultExecution timeMemory
723735rshohruhWorm Worries (BOI18_worm)C++14
10 / 100
1 ms208 KiB
#include <iostream> #include <bits/stdc++.h> #include <time.h> using namespace std; int N, Q, K, M; int ask(int x) { cout << "? " << x << " 1 1" << endl; int h; cin >> h; return h; } int main() { cin >> N >> M >> K >> Q; int left = 1, right = N; while (left < right) { int mid = (left + right) / 2; int h1 = ask(mid); int h2 = ask(mid + 1); if (h1 > h2) { right = mid; } else { left = mid + 1; } } cout << "! " << left << " 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...