ext/pb_ds/tree_policy.hpp和ext/pb_ds/assoc_container.hpp是什么?

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
int n, m, p, axis[50000005];
int main() {
scanf("%d%d%d", &n, &m, &p);
int l = INT_MAX, r = INT_MIN;
for (int i = 1; i <= n; i++) {
int x, y; scanf("%d%d", &x, &y);
axis[x]++, axis[y + 1]--;
l = min(l, x), r = max(r, y);
}
int sum = 0;
p = min(m, p);
unsigned long long ans = 0;
for (int i = l; i <= r; i++) {
sum += axis[i];
ans += (unsigned long long)(sum < p ? sum : p);
}
printf("%llu\n", ans);
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1328
难度
5
分类
数据结构 点击显示
标签
(无)
递交数
110
已通过
37
通过率
34%
被复制
5
上传者