Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int hi[30010];
- int main()
- {
- int n;
- scanf("%d", &n);
- while (n--) {
- int l, r, h;
- scanf("%d%d%d", &l, &r, &h);
- for (int i = l; i < r; ++i) {
- if (h > hi[i])
- hi[i] = h;
- }
- }
- for (int i = 1; i <= 30000; ++i) {
- if (hi[i] != hi[i-1])
- printf("%d %d\n", i, hi[i]);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment