Advertisement
Jarif_Rahman

Untitled

Feb 18th, 2021
1,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define pb push_back
  3. #define f first
  4. #define sc second
  5. using namespace std;
  6. typedef long long int ll;
  7. typedef string str;
  8. const int lim = 2e5;
  9. int main(){
  10.     ios_base::sync_with_stdio(0);
  11.     cin.tie(0);
  12.     int n = lim/2, q = lim;
  13.     cout << n << " " << q << "\n";
  14.     for(int i = 1; i < n; i++){
  15.         if(i == n/2) continue;
  16.         cout << "union " << i << " " << i+1 << "\n";
  17.         q--;
  18.     }
  19.     n/=2;
  20.     for(int i = 0; i < q; i++){
  21.         if(i%2 == 0) cout << "persist\n";
  22.         else if(i%2 == 1) cout << "union " << n << " " << n+1 << "\n";
  23.         else cout << "rollback\n";
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement