摘要: https://leetcode.cn/problems/find-the-power-of-k-size-subarrays-i/description/ 给你一个长度为 n 的整数数组 nums 和一个正整数 k 。 一个数组的 能量值 定义为: 如果 所有 元素都是依次 连续 且 上升 的,那 阅读全文
posted @ 2025-03-31 00:11 BiankaShenhen 阅读(26) 评论(0) 推荐(0)
摘要: https://leetcode.cn/problems/count-partitions-with-even-sum-difference/description/ class Solution { public: int countPartitions(vector& nums) { int c 阅读全文
posted @ 2025-03-30 19:42 BiankaShenhen 阅读(28) 评论(0) 推荐(0)
摘要: https://leetcode.cn/problems/reverse-integer/description/ 给你一个 32 位的有符号整数 x ,返回将 x 中的数字部分反转后的结果。 如果反转后整数超过 32 位的有符号整数的范围 [−231, 231 − 1] ,就返回 0。 假设环境不 阅读全文
posted @ 2025-03-02 20:09 BiankaShenhen 阅读(17) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1803 include include include using namespace std; vector<pair<int,int> > vct; int main(){ int n; scanf("%d", &n); fo 阅读全文
posted @ 2024-11-25 23:25 BiankaShenhen 阅读(21) 评论(0) 推荐(0)
摘要: https://leetcode.cn/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/description/ int countSubmatrices(int** grid, int gridSize, i 阅读全文
posted @ 2024-11-20 22:24 BiankaShenhen 阅读(21) 评论(0) 推荐(1)
摘要: https://leetcode.cn/problems/corporate-flight-bookings/description/ int* corpFlightBookings(int** bookings, int bookingsSize, int* bookingsColSize, in 阅读全文
posted @ 2024-11-19 20:48 BiankaShenhen 阅读(18) 评论(0) 推荐(0)
摘要: https://leetcode.cn/problems/check-if-all-the-integers-in-a-range-are-covered/description/ class Solution { public: bool isCovered(vector<vector>& ran 阅读全文
posted @ 2024-11-18 00:14 BiankaShenhen 阅读(16) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1102 include <bits/stdc++.h> define ll long long using namespace std; const int N = 2e5 + 10; int n , c; int a[N]; i 阅读全文
posted @ 2024-11-15 22:47 BiankaShenhen 阅读(41) 评论(0) 推荐(0)
摘要: //https://www.luogu.com.cn/problem/P2249 include using namespace std; int n,m,q,a[1000005]; int find(int x) { int l=1,r=n; while (l<r) { int mid=l+(r- 阅读全文
posted @ 2024-11-14 22:13 BiankaShenhen 阅读(20) 评论(0) 推荐(1)
摘要: bool hasIncreasingSubarrays(int* nums, int numsSize, int k) { int i; for(i=0;i<=numsSize-(2*k);i++){ int tmp=i; while(tmp<i+k-1){ if(nums[tmp]<nums[tm 阅读全文
posted @ 2024-11-13 20:03 BiankaShenhen 阅读(30) 评论(0) 推荐(0)