Skip to content

Commit

Permalink
change test to more_functional
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo314 committed May 17, 2024
1 parent d1ee72c commit e65b106
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test/atcoder-abc177-f.1.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ 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>{}();
int id = more_functional::MaxLimit<int>{}();
return f == id ? x : f + l;
}
};
struct Composition {
int operator() (int f, int g) {
int id = lazy_segtree::MaxLimit<int>{}();
int id = more_functional::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));
StaticLazySegTree<int, more_functional::Min<int>, more_functional::MaxLimit<int>, int, Mapping, Composition, more_functional::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) {
Expand All @@ -30,4 +30,4 @@ int main(void) {
int ans = seg.all_prod();
std::cout << (ans >= 1000000000 ? -1 : ans+i+1) << '\n';
}
}
}
6 changes: 3 additions & 3 deletions test/atcoder-abc177-f.2.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

int main(void) {
int h, w; std::cin >> h >> w;
int id = lazy_segtree::MaxLimit<int>{}();
LazySegTree seg(std::vector<int>(w, 0), lazy_segtree::Min<int>{}, id,
int id = more_functional::MaxLimit<int>{}();
LazySegTree seg(std::vector<int>(w, 0), more_functional::Min<int>{}, id,
[&](int f, int x, int l, int r) {
return f == id ? x : f + l;
},
Expand All @@ -27,4 +27,4 @@ int main(void) {
int ans = seg.all_prod();
std::cout << (ans >= 1000000000 ? -1 : ans+i+1) << '\n';
}
}
}

0 comments on commit e65b106

Please sign in to comment.