polygonal专题

Codeforces Round #488 by NEAR (Div. 2) B. Knights of a Polygonal Table

k最大是10, 按照power排序后 维护每个位置的前k大,注意k为0的情况 类似前缀和,每个位置的优先队列按照从小到大的顺序排列,同时保证队列的大小不超过k #include <bits/stdc++.h>using namespace std;const int maxn = 1e6 + 10;const int N = maxn;typedef long long ll;#def

(简单贪心)CodeForces 994B-Knights of a Polygonal Table

(简单贪心)CodeForces 994B-Knights of a Polygonal Table   题目链接:B. Knights of a Polygonal Table 思路: 题目大意是有n个杀手,每个杀手最多能杀k个Power值比他小的人,给出n个杀手各自的Power值和Money数,问每个杀手最多能获得多少Money 定义一个结构体,内含杀手的原始索引(排序会