# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201896 | MKopchev | Cake 3 (JOI19_cake3) | C++14 | 3400 ms | 15352 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;
const int nmax=2e5+42;
int n,m;
pair<int/*v*/,int/*c*/> inp[nmax];
bool cmp(pair<int/*v*/,int/*c*/> a,pair<int/*v*/,int/*c*/> b)
{
return a.second<b.second;
}
int in=0;
long long sum_in=0,sum_greatest=-1e18;
set< pair<int/*value*/,int/*position*/> > active;
set< pair<int/*value*/,int/*position*/> >::iterator it;
void to_add(int positon)
{
pair<int/*value*/,int/*position*/> current={inp[positon].first,positon};
in++;
sum_in+=current.first;
if(in<=m)
{
active.insert(current);
if(in==m)
{
sum_greatest=sum_in;
it=active.begin();
}
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... |