0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 15:12:00 +00:00
OI-codes/Luogu/P1904/P1904.cpp

23 lines
431 B
C++
Raw Normal View History

2021-07-03 12:30:49 +00:00
#include <bits/stdc++.h>
using namespace std;
int l, h, r, ml, mr, a[10005];
int main() {
while (cin >> l >> h >> r) {
ml = min(ml, l);
mr = max(mr, r);
for (int i = l; i < r; i++) {
a[i] = max(a[i], h);
}
}
for (int i = ml - 1; i <= mr; i++) {
if (a[i] != a[i - 1]) {
cout << i << ' ' << a[i] << ' ';
}
}
cout << endl;
return 0;
}