跳到正文

linyicen

597004

快乐学习,认真刷题,努力进步!

这是 2026年10月19日 存档的第 1 版,不是当前版本。查看当前版本

资料、奖项与版本

平衡树有交合并

loj6631

紫黑题

C++
//NOIP2026 RP++
#include <bits/stdc++.h>
#define fi first
#define se second
#define lc(x) (x<<1)
#define rc(x) (x<<1|1)
#define sort stable_sort
#define pii pair<int,int>
//#define int long long
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int MOD = 1e9 + 7; // !
inline int read(){
    int s = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9'){
        if (c == '-') f = -1;
        c = getchar();
    }
    while ('0' <= c && c <= '9'){
        s = (s << 1) + (s << 3) + c - '0';
        c = getchar();
    }
    return s * f;
}
inline void upd(int &x, int y){
    x = (x + y) % MOD;
}
inline int qpow(int x, int y){
    x %= MOD, y %= (MOD - 1);
    int re = 1, base = x;
    while (y){
        if (y & 1) re = 1ll * re * base % MOD;
        y >>= 1, base = 1ll * base * base % MOD;
    }
    return re;
}
inline void chkmax(int &x, int y){
    if (y > x) x = y;
}
inline void chkmin(int &x, int y){
    if (y < x) x = y;
}
void test(){
    /**/
}
signed main(){
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--){
        test();
    }
    return 0;
}