# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1130059 | Math4Life2020 | Two Currencies (JOI23_currencies) | C++20 | 5134 ms | 992580 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 int Nm = 1e5+5; const int E = 17;
const int 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;
int ncp = 0;
void prc(vector<pair<int,int>> m0) {
int n0=0; long long v0=0;
//mps[-INF]={0,0};
mps.push_back({{-INF,0},0LL});
for (pair<int,int> p0: m0) {
long long c1 = p0.first; int n1 = p0.second;
n0+=n1; v0+=c1*n1;
//mps[c1]={n0,v0};
mps.push_back({{c1,n0},v0});
}
}
vector<pair<int,int>> getm0() {
vector<pair<int,int>> vf;
int ntot = 0;
long long 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... |