제출 #399783

#제출 시각아이디문제언어결과실행 시간메모리
399783SortingWorm Worries (BOI18_worm)C++17
10 / 100
2 ms200 KiB
#include <bits/stdc++.h> using namespace std; int n, m, k, q; int query(int x){ cout << "? " << x << " " << 1 << " " << 1 << "\n"; cout.flush(); int ret; cin >> ret; return ret; } void answer(int x){ cout << "! " << x << " " << 1 << " " << 1 << "\n"; cout.flush(); exit(0); } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m >> k >> q; int l = 1, r = n; while(l != r){ int mid1 = (l + r) >> 1; int mid2 = mid1 + 1; int a = query(mid1), b = query(mid2); if(a >= b) r = mid1; else l = mid2; } answer(l); }
#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...