Skip to content

Commit

Permalink
restore abc177-f.1 and delete colopl2018_final-c
Browse files Browse the repository at this point in the history
  • Loading branch information
KowerKoint committed Apr 17, 2024
1 parent 41a18aa commit fd18809
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
33 changes: 33 additions & 0 deletions test/atcoder-abc177-f.1.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#define PROBLEM "https://atcoder.jp/contests/abc177/tasks/abc177_f"

#include <iostream>

#include "../cpp/lazy-segtree.hpp"

int main(void) {
int h, w; std::cin >> h >> w;
struct Mapping {
int operator() (int f, int x, int l, int r) {
int id = lazy_segtree::MaxLimit<int>{}();
return f == id ? x : f + l;
}
};
struct Composition {
int operator() (int f, int g) {
int id = lazy_segtree::MaxLimit<int>{}();
return f == id ? g : f;
}
};
StaticLazySegTree<int, lazy_segtree::Min<int>, lazy_segtree::MaxLimit<int>, int, Mapping, Composition, lazy_segtree::MaxLimit<int>> seg(std::vector<int>(w, 0));
for(int i = 0; i < h; i++) {
int a, b; std::cin >> a >> b; a--;
if(a == 0) {
// unreachable to [a,b)
seg.apply(a, b, 1000000000);
} else {
seg.apply(a, b, seg[a-1] + 1 - a);
}
int ans = seg.all_prod();
std::cout << (ans >= 1000000000 ? -1 : ans+i+1) << '\n';
}
}
16 changes: 0 additions & 16 deletions test/atcoder-colopl2018_final-c.test.cpp

This file was deleted.

0 comments on commit fd18809

Please sign in to comment.