摘要: 题目P2569 [SCOI2010] 股票交易 问题描述 我们需要帮助lxhgww制定一个交易策略,使得在 T 天内赚到最多的钱。每天的交易有以下限制: 第 i天的买入价为 AP_i,卖出价为 BP_i,且AP_i≥BP_i 第 i 天的买入上限为 AS_i,卖出上限为 BS_i 两次交易之间至少要 阅读全文
posted @ 2025-01-14 08:36 fufuaifufu 阅读(34) 评论(0) 推荐(0)
摘要: P5707 【深基2.例12】上学迟到 题目链接:https://www.luogu.com.cn/problem/P5707 题解代码: #include <bits/stdc++.h> using namespace std; int main() { int s, v; cin >> s >> 阅读全文
posted @ 2024-12-09 17:35 fufuaifufu 阅读(62) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode.cn/problems/identify-the-largest-outlier-in-an-array/description/ 题解代码: class Solution { public: int getLargestOutlier(std::vect 阅读全文
posted @ 2024-12-05 17:37 fufuaifufu 阅读(34) 评论(0) 推荐(0)
摘要: 1456.定长子串中元音的最大数目 题目链接:https://leetcode.cn/problems/maximum-number-of-vowels-in-a-substring-of-given-length/description/ 题解代码: class Solution { public 阅读全文
posted @ 2024-11-29 00:02 fufuaifufu 阅读(39) 评论(0) 推荐(0)
摘要: B2. The Strict Teacher (Hard Version) 题目链接:https://codeforces.com/contest/2005/problem/B2 题解代码: #include<bits/stdc++.h> using namespace std; int main( 阅读全文
posted @ 2024-11-24 16:40 fufuaifufu 阅读(14) 评论(0) 推荐(0)
摘要: 元素和小于等于 k 的子矩阵的数目 题目链接:https://leetcode.cn/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/description/ 题解代码: class Solution { pu 阅读全文
posted @ 2024-11-22 01:16 fufuaifufu 阅读(19) 评论(0) 推荐(1)
摘要: 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 阅读(13) 评论(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 阅读(23) 评论(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 阅读(19) 评论(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 阅读(17) 评论(0) 推荐(0)