dp动态规划 + 贪心算法 [信息学奥赛一本通T1260-拦截导弹]--NOIP1999 提高组 -- 最详细题解 #dp最长上升子序列模型额外加一点贪心######本题有两个问题####1.一个防御系统最多能拦截多少个导弹按照题目所说一个防御系统只能从最高的往下打换句话说也就是求从向往下能打的最多的导弹是多少######仔细一想就能想到运用最长上升子序列的模型求一个反向最长上升子序列(最长下降子序列)这个好解决背 题解列表 2024年09月19日 2 点赞 1 评论 700 浏览 评分:9.9
[信息学奥赛一本通T1684-Secret Message 秘密信息] 平平无奇的Trie树 ```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN=5*1e5+10,M=2*1e4+10,inf=0x3f3f3f3f;intn, 题解列表 2024年09月19日 0 点赞 1 评论 453 浏览 评分:9.9
c++ 一步到位 摘要:解题思路:直接输出注意事项:输入输出的符号不要搞反就好参考代码:#include<iostream>using namespace std;int main(){ int a,sum; c…… 题解列表 2024年09月18日 0 点赞 0 评论 751 浏览 评分:0.0
[搭配购买(buy)] 并查集 + dp动态规划(一维优化版) #并查集+动态规划一维优化######分析题目所有的云朵都有关联可以联想到并查集将所有的相关元素全部存进根节点并将其视为一个大的连通块(整体)######同时又是一眼的dp模型(01背包模型)#####思路就很清楚了在前n个物品中花费x元买到价值最大的组合######状态转移方程:f[j]=max(f 题解列表 2024年09月18日 0 点赞 0 评论 697 浏览 评分:9.9
[信息学奥赛一本通T1471-Phone List] Trie字典树做法 摘要:# Trie tree: [ std::cin >> student.scores…… 题解列表 2024年09月17日 0 点赞 0 评论 797 浏览 评分:9.9
二进制分类 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int wei(int n) { int cnt=0; while(n!=0) {…… 题解列表 2024年09月17日 0 点赞 0 评论 343 浏览 评分:0.0
二进制移位练习 摘要:参考代码:#include<bits/stdc++.h> using namespace std; //int wei(int n) //{ // int cnt=0; // while(n…… 题解列表 2024年09月17日 0 点赞 0 评论 472 浏览 评分:0.0
位运算是个简便方法 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int wei(int n) { int cnt=0; while(n!=0) {…… 题解列表 2024年09月17日 0 点赞 0 评论 533 浏览 评分:0.0
1049:结构体之时间设计--思路 #C++ 摘要:##### 闰年条件 1. 4 的倍数 2. 400 的倍数 ```cpp year % 4 == 0 && year % 100 != 0 //% 取模 ``` ```cpp …… 题解列表 2024年09月17日 1 点赞 0 评论 617 浏览 评分:0.0