Language: C++

#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ld PI = acos(-1.0);
const ld EPS = 1e-11;

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#pragma endregion

inline void Assert(bool b)
{
  if (!b)
    exit(1);
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(30) << setiosflags(ios::fixed);

  int q;
  cin >> q;
  ll b_sum = 0;
  priority_queue<ll> L;
  smaller_queue<ll> R;
  ll Ls = 0, Rs = 0;
  rep(qi, q)
  {
    int type;
    cin >> type;
    if (type == 1)
    {
      ll a, b;
      cin >> a >> b;
      b_sum += b;
      if (L.empty())
      {
        Ls += a;
        L.push(a);
      }
      else if (R.empty())
      {
        if (a < L.top())
        {
          Rs += L.top();
          R.push(L.top());
          Ls -= L.top();
          L.pop();
          Ls += a;
          L.push(a);
        }
        else
        {
          Rs += a;
          R.push(a);
        }
      }
      else if (a < L.top())
      {
        Rs += L.top();
        R.push(L.top());
        Ls -= L.top();
        L.pop();
        Ls += a;
        L.push(a);
      }
      else if (a > R.top())
      {
        Ls += R.top();
        L.push(R.top());
        Rs -= R.top();
        R.pop();
        Rs += a;
        R.push(a);
      }
      else
      {
        Rs += a;
        R.push(a);
      }
      if (L.size() - R_size() == 2)
      {
        Rs += L.top();
        L.pop();
      }

      if (L.size() < R.size())
      {
        Ls += R.top();
        L.push(R.top());
        Rs -= R.top();
        R.pop();
      }
      Assert((int)L.size() - (int)R.size() == 0 || (int)L.size() - (int)R.size() == 1);
    }
    else if (type == 2)
    {
      ll sz = (int)L.size() + (int)R.size();
      ll x = L.top();
      ll val = Rs - Ls + x * (sz % 2) + b_sum;
      cout << x << " " << val << "\n";
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:112:22: error: 'R_size' was not declared in this scope; did you mean 'dysize'?
  112 |       if (L.size() - R_size() == 2)
      |                      ^~~~~~
      |                      dysize