# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1130037 | Math4Life2020 | Two Currencies (JOI23_currencies) | C++20 | 889 ms | 377896 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = int; using pii = pair<ll,ll>;
const ll Nm = 1e5+5; const ll E = 18;
const ll INF = 1e9;
struct Node {
//map<ll,ll> m0; //cost->number
//map<ll,pii> mps; //aggregate: cost -> {# <=cost, val <=cost}
//vector<pair<int,int>> m0;
vector<pair<pair<int,int>,long long>> mps;
ll ncp = 0;
void prc(vector<pair<int,int>> m0) {
ll n0=0; ll v0=0;
//mps[-INF]={0,0};
mps.push_back({{-INF,0},0LL});
for (pii p0: m0) {
ll c1 = p0.first; ll n1 = p0.second;
n0+=n1; v0+=n1*c1;
//mps[c1]={n0,v0};
mps.push_back({{c1,n0},v0});
}
}
vector<pii> getm0() {
vector<pii> vf;
long long ntot = 0;
long long vtot = 0;
for (auto A0: mps) {
if (A0.first.first==(-INF)) {
continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |