# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1130053 | Math4Life2020 | Two Currencies (JOI23_currencies) | C++20 | 5136 ms | 1114112 KiB |
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 1e5+5; const ll E = 17;
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;
ll ntot = 0;
ll vtot = 0;
for (auto A0: mps) {
# | 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... |