# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
820164 | rnl42 | Cake 3 (JOI19_cake3) | C++14 | 4056 ms | 7996 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
#define int long long
struct Perle {
int t, c;
bool operator<(const Perle& other) {
return t < other.t;
}
};
int N, M;
vector<Perle> perles;
signed main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> N >> M;
perles.resize(N);
for (int i = 0; i < N; i++) {
cin >> perles[i].c >> perles[i].t;
}
sort(perles.begin(), perles.end());
int ans = -1e18;
for (int deb = 0; deb < N; deb++) {
int sum = 0;
priority_queue<int,vector<int>,greater<int>> pq;
for (int fin = deb; fin < N; fin++) {
if (fin > deb+M-1) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |