# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1160431 | fryingduc | Cake 3 (JOI19_cake3) | C++20 | 0 ms | 328 KiB |
#include "bits/stdc++.h"
using namespace std;
#ifdef duc_debug
#include "bits/debug.h"
#else
#define debug(...)
#endif
const int maxn = 2e5 + 5;
int n, m, v[maxn], c[maxn];
int ord[maxn];
void solve() {
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
cin >> v[i] >> c[i];
ord[i] = i;
}
sort(ord + 1, ord + n + 1, [](const int &x, const int &y) -> bool {
return c[x] < c[y];
});
set<pair<long long, int>> s;
long long sum = 0;
int cur_mn = 1;
set<int> cand;
for (int i = 1; i < m; ++i) {
if (i == 1) {
s.insert(make_pair(1ll * v[ord[i]] + 2 * c[ord[i]], i));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |