Submission #90564

#TimeUsernameProblemLanguageResultExecution timeMemory
90564MilkiNizovi (COI14_nizovi)C++14
0 / 100
35 ms552 KiB
#include<bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = a; i < b; ++i) #define REP(i, n) FOR(i, 0, n) #define _ << " " << #define sz(x) ((int) x.size()) #define pb(x) push_back(x) typedef long long ll; typedef pair<int, int> point; int a, b; int cmp(int x, int y){ cout << "cmp" _ x _ y << "\n"; fflush(stdout); int ret; cin >> ret; return ret; } void rev(int x, int y){ cout << "reverse" _ x _ y << "\n"; fflush(stdout); } int main(){ cin >> a >> b; int total = a + b, curr = a; while(curr){ int lo = curr + 1, hi = total; while(lo < hi){ int mid = (lo + hi) >> 1; int ans = cmp(curr, mid); if(ans == -1) hi = mid; else if(ans == 1) lo = mid + 1; else{ lo = mid; break; } } rev(curr, lo); rev(curr, lo - 1); curr --; total = lo; } cout << "end"; fflush(stdout); }
#Verdict Execution timeMemoryGrader output
Fetching results...