Skip to content

count_paths: define vl locally instead of relying on kactl NTT typedef#235

Merged
cameroncuster merged 1 commit into
devfrom
count-paths-vl
Jul 8, 2026
Merged

count_paths: define vl locally instead of relying on kactl NTT typedef#235
cameroncuster merged 1 commit into
devfrom
count-paths-vl

Conversation

@cameroncuster

Copy link
Copy Markdown
Member

count_paths_rectangle.hpp and count_paths_triangle.hpp use the vl type alias without defining it — it silently leaks from kactl's NumberTheoreticTransform.h (typedef vector<ll> vl;). If kactl ever renames or drops that typedef, these headers stop compiling.

Fix: declare using vl = vector<ll>; in count_paths_rectangle.hpp (triangle includes rectangle, so one definition covers both). This matches the existing pattern in wildcard_pattern_matching.hpp.

Notes:

  • The alias legally coexists with kactl's identical typedef — verified that redeclaration compiles clean with -Wall -Wextra
  • Both count_paths tests compile; clang-format passes
  • Deliberately not promoting vl into kactl_macros.hpp/template.cpp: that would diverge from upstream KACTL's template (which defines only vi/pii/ll), i.e. change what the team hand-types at contest. The remaining ~20 vector<ll> spell-outs are consistent with KACTL convention and left as-is.

@cameroncuster cameroncuster merged commit 5f91432 into dev Jul 8, 2026
7 of 8 checks passed
@cameroncuster cameroncuster deleted the count-paths-vl branch July 8, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant