// Problem: F. Flipping Range // Contest: Codeforces - Codeforces Round #768 (Div. 2) // URL: https://codeforces.com/contest/1631/problem/F // Memory Limit: 256 MB // Time Limit: 2000 ms // TestType: single // // Powered by CP Editor (https://cpeditor.org)
/* Name: Author: xiaruize Date: */
#include<bits/stdc++.h> usingnamespace std; #define int long long #define ull unsigned long long #define MOD 1000000007 #define ALL(a) (a).begin(), (a).end() #define pb push_back #define mk make_pair #define pii pair<int, int> #define pis pair<int, string> #define sec second #define ll long long #define fir first #define sz(a) int((a).size()) #define double long double #define INF 0x3f3f3f3f #define debug(c, x) cerr << c << ':' << x << endl; constint N = 2e5 + 10;
// bool st; int t; int n; int a[N]; // bool en;
voidsolve() { int ans = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } int num = a[n]; for (int i = n; i >= 1; i--) { while (a[i] == num) i--; if (i < 1) break; ans++; i = n - 2 * (n - i) + 1; cerr << t << ' ' << i << endl; } cout << ans << endl; }
// Problem: C. And Matching // Contest: Codeforces - Codeforces Round #768 (Div. 2) // URL: https://codeforces.com/contest/1631/problem/C // Memory Limit: 256 MB // Time Limit: 1000 ms // TestType: single // // Powered by CP Editor (https://cpeditor.org)
/* Name: Author: xiaruize Date: */ #include<bits/stdc++.h> usingnamespace std; #define int long long #define ull unsigned long long #define MOD 1000000007 #define ALL(a) (a).begin(), (a).end() #define pb push_back #define mk make_pair #define pii pair<int, int> #define pis pair<int, string> #define sec second #define ll long long #define fir first #define sz(a) int((a).size()) #define double long double #define INF 0x3f3f3f3f #define debug(c, x) cerr << c << ':' << x << endl; constint N = 1e5 + 10;
// bool st; int t; int n, k; int a[N]; // bool en;
voidsolve() { cin >> n >> k; int m = n; if (k == 3 && n == 4) { cout << "-1" << endl; return; } for (int i = 0; i < n; i++) a[i] = i; while (n) { if (k >= n / 2) { swap(a[n / 2], a[0]); k -= n / 2; } n /= 2; } for (int i = 0; i < m / 2; i++) cout << a[i] << ' ' << a[m - i - 1] << endl; }