# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897591 | penguin133 | Cake 3 (JOI19_cake3) | C++17 | 2272 ms | 15116 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 <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
//#define int long long
typedef long long ll;
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, m;
pi A[200005];
multiset <int> ms, buf;
int L = 1, R = 0, x, y;
ll cur = 0, ans = -1e18;
inline void shift(const int l, const int r){
while(L < l){
if(buf.find(A[L].se) != buf.end())buf.erase(buf.find(A[L].se));
else {
ms.erase(ms.find(A[L].se)), cur -= A[L].se;
}
while(ms.size() < m && !buf.empty()){
x = *--buf.end();
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |