摘要: 1108.IP 地址无效化 题目链接:https://leetcode.cn/problems/defanging-an-ip-address/description/ 题解代码: class Solution { public: string defangIPaddr(string address 阅读全文
posted @ 2024-11-20 01:37 fufuaifufu 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 504.七进制数 题目链接:https://leetcode.cn/problems/base-7/description/ 题解代码: class Solution { public: string convertToBase7(int num) { string nums; int a=abs( 阅读全文
posted @ 2024-11-20 01:34 fufuaifufu 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1109.航班预订统计 题目链接:https://leetcode.cn/problems/corporate-flight-bookings/description/ 题解代码: class Solution { public: vector<int> corpFlightBookings(vec 阅读全文
posted @ 2024-11-19 20:43 fufuaifufu 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 零数组变换 I 题目链接:https://leetcode.cn/problems/zero-array-transformation-i/description/ 题解代码: class Solution { public: bool isZeroArray(vector<int>& nums, 阅读全文
posted @ 2024-11-17 17:26 fufuaifufu 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P1102 题解代码: //双指针 #include<bits/stdc++.h> using namespace std; const int MAX = 2 * 10e5 + 10; int n, c, nums[MAX 阅读全文
posted @ 2024-11-16 01:45 fufuaifufu 阅读(2) 评论(0) 推荐(1) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P2249 题解代码: #include<iostream> using namespace std; int n, m, q, a[1000005]; int find(int x); int main() { cin > 阅读全文
posted @ 2024-11-15 02:45 fufuaifufu 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.cn/problems/adjacent-increasing-subarrays-detection-ii/ 题解代码: int maxIncreasingSubarrays(int* nums, int numsSize) { int ans = 0, 阅读全文
posted @ 2024-11-14 00:31 fufuaifufu 阅读(12) 评论(0) 推荐(1) 编辑
摘要: 题目链接: https://leetcode.cn/problems/minimum-element-after-replacement-with-digit-sum/ 题解代码: int minElement(int* nums, int numsSize) { int temp=10000; w 阅读全文
posted @ 2024-11-12 21:56 fufuaifufu 阅读(6) 评论(0) 推荐(0) 编辑