Submission #579281

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5792812022-06-18 18:50:31lumibonsTwo Antennas (JOI19_antennas)C++17
100 / 100
905 ms42244 KiB
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 1;
struct sdata {
int minhl = inf, maxhl = -inf, maxcost = -1;
};
struct operation {
int minhr = inf, maxhr = -inf;
};
sdata combine(sdata dl, sdata dr) {
return { min(dl.minhl, dr.minhl), max(dl.maxhl, dr.maxhl), max(dl.maxcost, dr.maxcost) };
}
sdata calculate(operation o, sdata d) {
return { d.minhl, d.maxhl, max(d.maxcost, max(o.maxhr - d.minhl, d.maxhl - o.minhr)) };
}
operation merge(operation ot, operation ob) {
return { min(ot.minhr, ob.minhr), max(ot.maxhr, ob.maxhr) };
}
const int sn = 1 << 18;
sdata s[2 * sn];
operation o[sn];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...