Submission #1337579

#TimeUsernameProblemLanguageResultExecution timeMemory
1337579NikoBaoticNizovi (COI14_nizovi)C++20
20 / 100
5 ms444 KiB
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;

#define F first
#define S second
#define FIO ios_base::sync_with_stdio(false); cin.tie(0)
#define sz(x) ((int)((x).size()))
#define all(x) x.begin(), x.end()
#define pb push_back
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e6 + 10;

bool cmp(int a, int b) {
	if (a == b) return 0;
	cout << "cmp " << a << " " << b << endl;
	int x;
	cin >> x;
	return x == 1;
}

void rev(int a, int b) {
	if (a == b) return;
	cout << "reverse " << a << " " << b << endl;
}

int na, nb;

int main() {
	FIO;

	cin >> na >> nb;

	int r = na + 1;
	int tar = na;

	for (int l = 1; l <= tar; l++) {
		if (cmp(l, r)) {
			rev(l, r);
			rev(l + 1, r);

			tar++;
			r++;
		}
	}

	cout << "end" << endl;

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...