From 1880ccb6d85c6eb79e724593457877bab431951c Mon Sep 17 00:00:00 2001 From: Gloria Mundi Date: Sat, 16 Nov 2024 21:17:29 +0100 Subject: get rid of all() and sz() --- content/string/trie.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content/string/trie.cpp') diff --git a/content/string/trie.cpp b/content/string/trie.cpp index d5e092c..db39c43 100644 --- a/content/string/trie.cpp +++ b/content/string/trie.cpp @@ -3,7 +3,7 @@ constexpr int ALPHABET_SIZE = 2; struct node { int words, ends; array nxt; - node(): words(0), ends(0) { fill(all(nxt), -1); } + node(): words(0), ends(0) { ranges::fill(nxt, -1); } }; vector trie = {node()}; @@ -13,7 +13,7 @@ int traverse(const vector& word, int x) { if (id < 0 || (trie[id].words == 0 && x <= 0)) return -1; trie[id].words += x; if (trie[id].nxt[c] < 0 && x > 0) { - trie[id].nxt[c] = sz(trie); + trie[id].nxt[c] = ssize(trie); trie.emplace_back(); } id = trie[id].nxt[c]; -- cgit v1.2.3