摘要: 滑动窗口使用前提: 连续子数组。 有单调性。本题元素均为正数,这意味着只要某个子数组满足题目要求,在该子数组内的更短的子数组同样也满足题目要求。 一、不定长滑动窗口(求最短/最小) 209.长度最小的子数组 class Solution { public: int minSubArrayLen(in 阅读全文
posted @ 2024-07-13 15:26 胖柚の工作室 阅读(29) 评论(0) 推荐(0)
摘要: 1、__builtin_popcount 的使用 1.1 1的数量 #include <bits/stdc++.h> using namespace std; using i64 = long long; void solve() { int x; cin >> x; int t = __built 阅读全文
posted @ 2024-07-13 10:53 胖柚の工作室 阅读(14) 评论(0) 推荐(0)