摘要:
题目P6306 「Wdsr-1」小铃的书 题目分析 核心问题: 小铃的书有 n-1 本,编号满足每种编号的书的数量是 k 的倍数 混入了一本魔理沙的魔导书(编号未知),现在总共有 n 本书 我们需要找出这本魔导书的编号 性质分析: 由于小铃的书编号数量满足倍数关系,每种编号的书的数量在 n-1 本书 阅读全文
摘要:
题目:P1470 [USACO2.3] 最长前缀 Longest Prefix 题目解析 问题描述 给定一个元素集合 ( P ) 和一个大写字母序列 ( s ),要求找到 ( s ) 的最长前缀 ( s' ),使得 ( s' ) 可以由 ( P ) 中的元素组成。元素可以重复使用,但不一定要全部出现 阅读全文
摘要:
题目P2569 [SCOI2010] 股票交易 问题描述 我们需要帮助lxhgww制定一个交易策略,使得在 T 天内赚到最多的钱。每天的交易有以下限制: 第 i天的买入价为 AP_i,卖出价为 BP_i,且AP_i≥BP_i 第 i 天的买入上限为 AS_i,卖出上限为 BS_i 两次交易之间至少要 阅读全文
摘要:
P5707 【深基2.例12】上学迟到 题目链接:https://www.luogu.com.cn/problem/P5707 题解代码: #include <bits/stdc++.h> using namespace std; int main() { int s, v; cin >> s >> 阅读全文
摘要:
题目链接:https://leetcode.cn/problems/identify-the-largest-outlier-in-an-array/description/ 题解代码: class Solution { public: int getLargestOutlier(std::vect 阅读全文
摘要:
1456.定长子串中元音的最大数目 题目链接:https://leetcode.cn/problems/maximum-number-of-vowels-in-a-substring-of-given-length/description/ 题解代码: class Solution { public 阅读全文
摘要:
B2. The Strict Teacher (Hard Version) 题目链接:https://codeforces.com/contest/2005/problem/B2 题解代码: #include<bits/stdc++.h> using namespace std; int main( 阅读全文
摘要:
元素和小于等于 k 的子矩阵的数目 题目链接:https://leetcode.cn/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/description/ 题解代码: class Solution { pu 阅读全文
摘要:
1108.IP 地址无效化 题目链接:https://leetcode.cn/problems/defanging-an-ip-address/description/ 题解代码: class Solution { public: string defangIPaddr(string address 阅读全文
摘要:
504.七进制数 题目链接:https://leetcode.cn/problems/base-7/description/ 题解代码: class Solution { public: string convertToBase7(int num) { string nums; int a=abs( 阅读全文