Submission #680566

#TimeUsernameProblemLanguageResultExecution timeMemory
680566Cross_RatioWorm Worries (BOI18_worm)C++14
10 / 100
2 ms288 KiB
#include <bits/stdc++.h> using namespace std; int query(int a, int b, int c) { cout << "? " << a << ' ' << b << ' ' << c << endl; int d; cin >> d; return d; } void answer(int a, int b, int c) { cout << "! " << a << ' ' << b << ' ' << c << endl; return; } void subtask_12() { int N = 1000000; int s = 1, e = N; while(s<=e) { if(s==e) { answer(s, 1, 1); return; } if(s+1==e) { if(query(s, 1, 1) >= query(e, 1, 1)) { answer(s, 1, 1); return; } else { answer(e, 1, 1); return; } } int mid = (s + e) / 2; if(query(mid, 1, 1) <= query(mid+1, 1, 1)) { s = mid + 1; } else e = mid; } } void subtask_34() { } void subtask_56() { } signed main() { int N, M, K, Q; cin >> N >> M >> K >> Q; if(M==1 && K == 1 && N == 1000000) { subtask_12(); } if(K==1 && N==M) { subtask_34(); } if(K==N && K==M) { subtask_56(); } }
#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...