# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1161778 | Math4Life2020 | Constellation 3 (JOI20_constellation3) | C++20 | 252 ms | 52120 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 2e5+5; const ll INF = 1e18;
struct Node {
ll cht = 0;
ll lzadd = 0; //lazy add tag
ll vnh = 0; //value at no height
map<ll,ll> mht; //map: height -> value, must be strictly increasing
Node(){}
void print() {
return;
cout << "cht="<<cht<<", lzadd="<<lzadd<<", vnh="<<vnh<<"\n";
cout << "mht: \n";
for (pii p0: mht) {
cout << "term: "<<p0.first<<" "<<p0.second<<"\n";
}
}
Node(ll _cht, vector<pii> velem) {
cht = _cht;
sort(velem.begin(),velem.end());
ll cmax = 0;
for (pii p0: velem) {
if (p0.second>cmax) {
mht[p0.first]=p0.second;
cmax = p0.second;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |