06 2024 档案

摘要:题目 P0764. 小可的糖果盒 思路 题目要求是贪心,但是个人觉得dp更有性价比 代码 #include <iostream> #include <vector> #include <algorithm> using namespace std; int min_candies(int n, in 阅读全文
posted @ 2024-06-29 11:22 mcr130102 阅读(28) 评论(0) 推荐(0) 编辑
摘要:题目 #P0401. 逆波兰表达式 思路 都写着递归了,还算简单 代码 #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; double exp() { char s[20]; cin >> s; 阅读全文
posted @ 2024-06-26 23:08 mcr130102 阅读(11) 评论(0) 推荐(0) 编辑
摘要:动态规划的优缺点是什么? 动态规划的优点是: 可以解决一些复杂的问题,例如背包问题、最长公共子序列问题等; 可以通过记忆化搜索来避免重复计算,提高效率; 可以通过状态转移方程来简化问题,使问题更易于理解和解决; 可以处理连续的问题,例如最大子段和问题。 动态规划的缺点是: 对于某些问题,动态规划的时 阅读全文
posted @ 2024-06-26 22:55 mcr130102 阅读(27) 评论(0) 推荐(0) 编辑
摘要:题目 P0646. [NOIP2016提高组] 换教室 思路 简单很难的D规划P 代码 #include<bits/stdc++.h> using namespace std; int dis[305][305]; constexpr int _SIZE = 2e3; int n, m, v, e; 阅读全文
posted @ 2024-06-25 20:52 mcr130102 阅读(7) 评论(0) 推荐(0) 编辑
摘要:题目 P0891. 四次方数 思路 简单的动态规划 代码 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int m; int v[19] = {1, 16, 81, 256, 625, 1296 阅读全文
posted @ 2024-06-24 20:40 mcr130102 阅读(12) 评论(0) 推荐(0) 编辑
摘要:题目 P0609. 质因分解加强版 思路 代码 #include <iostream> #include <vector> #include <string> std::string primeFactorization(int n) { std::vector<int> factors; std: 阅读全文
posted @ 2024-06-22 15:37 mcr130102 阅读(11) 评论(0) 推荐(0) 编辑
摘要:题目 kedaOJ#P2849时间涟漪 思路 栈 代码 #include<bits/stdc++.h> using namespace std; int main() { int N; cin >> N; stack<int> timeRipples; int maxEnergy = INT_MIN 阅读全文
posted @ 2024-06-22 14:34 mcr130102 阅读(13) 评论(0) 推荐(0) 编辑
摘要:题目 kedaOJ#P2708电动车骑行 思路 双指针,好像就是尺取法 代码 #include<bits/stdc++.h> using namespace std; int main() { int w, n; cin >> w >> n; vector<int> weights(n); for 阅读全文
posted @ 2024-06-22 14:31 mcr130102 阅读(10) 评论(0) 推荐(0) 编辑
摘要:题目 kedaOJ#P1530一起摇摆 思路 无 代码 #include<bits/stdc++.h> int main() { int n; std::cin >> n; std::vector<int> arr1(n); std::vector<int> arr2(n); for (int i 阅读全文
posted @ 2024-06-22 14:28 mcr130102 阅读(10) 评论(0) 推荐(0) 编辑
摘要:题目 kedaOJ#P1529有趣的字母 思路 直接模拟,比较复杂的是找到最后一个字符 代码 #include<bits/stdc++.h> int main() { std::vector<char> vowels = {'a', 'e', 'i', 'o', 'u'}; int n; std:: 阅读全文
posted @ 2024-06-22 14:26 mcr130102 阅读(7) 评论(0) 推荐(0) 编辑
摘要:题目 [USACO 21DEC.B] Lonely Photo 思路 include<bits/stdc++.h> using namespace std; define int long long define N 500010 int n, m, i, j, k; int l[N], r[N], 阅读全文
posted @ 2024-06-22 13:32 mcr130102 阅读(7) 评论(0) 推荐(0) 编辑
摘要:题目 P1131. 【模板】最大公约数和最小公倍数 思路 可以使用C++STL的__gcd()函数 别试了,没有__lcm() 代码 #pragma GCC optimize(3) #include<bits/stdc++.h> using namespace std; main() { int a 阅读全文
posted @ 2024-06-20 08:39 mcr130102 阅读(13) 评论(0) 推荐(0) 编辑
摘要:题目#P0017. [NOIP2011普及组] 数字反转 思路 无 代码 #include <stdio.h> int main() { int x, s = 0; scanf("%d", &x); if (x < 0) { printf("-"); x = x * (-1); } while (x 阅读全文
posted @ 2024-06-17 19:56 mcr130102 阅读(12) 评论(0) 推荐(0) 编辑
摘要:catoiOS 这是什么? catoiOS(cats Olympiad in Informatics Open System),是一个丰富多样的开放系统,其代码符合跨平台要求。 它包含游戏、工具,还有个性化设置。包括各种活动在内,catoiOS致力于满足用户的所有需求 如何查看、下载catoiOS 阅读全文
posted @ 2024-06-17 19:54 mcr130102 阅读(103) 评论(0) 推荐(0) 编辑

请不要抄袭任何人的博客,这是对一名开发者最基本的尊重。
点击右上角即可分享
微信分享提示
想一个人有多想念,那又是文字失效瞬间。