# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136375 | dombly | Two Currencies (JOI23_currencies) | C++20 | 3701 ms | 518192 KiB |
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,lzcnt")
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 262144; const ll E = 18; const ll INF = 2e18;
struct Node {
map<ll,ll> m0; //{cost -> #}
//map<ll,pii> mps; //{aggregate cost, aggregate # at val}
vector<array<ll,3>> mps;
ll cptot = 0;
void prc() {
//mps[-INF]={0,0};
mps.push_back({-INF,0,0});
ll nc = 0; ll vc = 0;
for (pii p0: m0) {
ll n1 = p0.second; ll c1 = p0.first;
nc += n1; vc += n1*c1;
//mps[c1]={vc,nc};
mps.push_back({c1,vc,nc});
}
}
Node(){}
Node(vector<ll> v1) {
for (ll x: v1) {
if (x>0) {
m0[x]++;
cptot++;
} else {
# | 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... |