您的当前位置:首页正文

The 17th Zhejiang Provincial Collegiate Programming Contest E Easy DP Problem--主席树

2024-11-23 来源:个人技术集锦


用主席树维护区间 [ l , r ] [l,r] [l,r]的前k大数的和

#include<bits/stdc++.h>
#include <unordered_map>
using namespace std;
template<class...Args>
void debug(Args... args) {
   //Parameter pack
    auto tmp = {
    (cout << args << ' ', 0)... };
    cout << "\n";
}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll>pll;
typedef pair<int, int>pii;
const ll N = 5e5 + 5;
const ll MOD = 998244353;
const ll INF = 0x7ffffffff;

vector<int> num;
int getid(int x) {
   
    return lower_bound(num.begin(), num.
显示全文