auto optimize_cpp_stdio = []() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); return0; }(); classSolution { public: conststaticint maxn = 1e5 + 10; conststaticint maxm = 1e5 + 10; constint INF = 0x3f3f3f3f; intmaxSubarrays(vector<int> &nums) { int sum = nums[0]; int n = nums.size(); for (int i = 1; i < n; ++i) { sum &= nums[i]; } if (sum != 0) return1; int curSum = (1 << 20) - 1; int cnt = 0; for (int i = 0; i < n; ++i) { curSum &= nums[i]; if (curSum == 0) { cnt++; if (i == n - 1) break; curSum = (1 << 20) - 1; } } return cnt; } };