summaryrefslogtreecommitdiff
path: root/content/math/longestIncreasingSubsequence.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /content/math/longestIncreasingSubsequence.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'content/math/longestIncreasingSubsequence.cpp')
-rw-r--r--content/math/longestIncreasingSubsequence.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/content/math/longestIncreasingSubsequence.cpp b/content/math/longestIncreasingSubsequence.cpp
index fcb63b4..e4863d0 100644
--- a/content/math/longestIncreasingSubsequence.cpp
+++ b/content/math/longestIncreasingSubsequence.cpp
@@ -1,8 +1,8 @@
vector<int> lis(vector<ll>& a) {
- int n = sz(a), len = 0;
+ int n = ssize(a), len = 0;
vector<ll> dp(n, INF), dp_id(n), prev(n);
for (int i = 0; i < n; i++) {
- int pos = lower_bound(all(dp), a[i]) - dp.begin();
+ int pos = ranges::lower_bound(dp, a[i]) - begin(dp);
dp[pos] = a[i];
dp_id[pos] = i;
prev[i] = pos ? dp_id[pos - 1] : -1;