Submission #798497

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7984972023-07-30 18:56:26rnl42Two Antennas (JOI19_antennas)C++14
100 / 100
516 ms43712 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
constexpr int INF = 1e9+42;
struct Antenna {
int h, a, b;
};
struct Query {
int l, r, qid;
bool operator<(const Query& other) const {
return r == other.r ? l < other.l : r < other.r;
}
};
struct nodepos {
int maxfull = -INF, bestheight = +INF;
nodepos() {}
nodepos(int maxfull, int bestheight) : maxfull(maxfull), bestheight(bestheight) {}
void update(nodepos k) {
bestheight = k.bestheight;
}
nodepos merge(const nodepos& other) const {
return nodepos(max(maxfull, other.maxfull), min(bestheight, other.bestheight));
}
void apply(int h) {
maxfull = max(maxfull, h-bestheight);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

antennas.cpp: In function 'int main()':
antennas.cpp:147:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  147 |   for (auto [k, type] : events[R]) {
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...