Skip to content

Commit

Permalink
golf
Browse files Browse the repository at this point in the history
  • Loading branch information
lrvideckis committed Nov 22, 2024
1 parent 80cb277 commit 0d587c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions library/monotonic_stack/count_rectangles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ vector<vi> count_rectangles(
vector cnt(n + 1, vector(m + 1, 0));
vi h(m);
for (const auto& row : grid) {
transform(all(h), begin(row), begin(h),
[](int a, bool g) { return g * (a + 1); });
rep(j, 0, m) h[j] = row[j] * (h[j] + 1);
vi l(mono_st(h, less())), r(mono_range(l));
rep(j, 0, m) {
int cnt_l = j - l[j] - 1, cnt_r = r[j] - j - 1;
Expand Down
1 change: 1 addition & 0 deletions library/strings/suffix_array/suffix_array_short.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
//! https://github.com/atcoder/ac-library/blob/master/atcoder/string.hpp
//! @code
//! // requires s[i]>=0
//! auto [sa2, sa_inv2, lcp2] = sa_short(s);
//! @endcode
//! runs in ~1.5s for 5e5
Expand Down

0 comments on commit 0d587c8

Please sign in to comment.