dp--最长上升子序列模型//闫氏dp法 摘要:# dp基础入门 上升子序列模型 ## 闫氏dp法 同系列基础dp算法链接:[dp--数字三角形模型](https://blog.dotcpp.com/a/106383 "dp--数字三角形模型"…… 题解列表 2024年09月16日 0 点赞 0 评论 517 浏览 评分:9.9
STL不好用,结构体解决 摘要:注意事项:按列表B的出现顺序输出是难点,map是自动排序的,unordered_map是随机排序的,不好解决输出顺序问题。参考代码:#include<bits/stdc++.h> using nam…… 题解列表 2024年09月15日 0 点赞 0 评论 339 浏览 评分:0.0
dp--数字三角形模型系列//闫氏dp法 #闫氏dp法######跟着y总学过算法的都知道y总的dp分析思路很nb在这里分享一下######做dp不能想着怎么得到最大最优而是要思考得到的过程;;######所以我们很简单的就能 题解列表 2024年09月15日 0 点赞 1 评论 559 浏览 评分:9.9
[信息学奥赛一本通T1236-区间合并] 区间合并( ᗜ`˰´ᗜ ) ##代码```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN=1e7+10,M=2*1e3+10, 题解列表 2024年09月15日 0 点赞 1 评论 492 浏览 评分:9.9
dfs--字符转数存状态//[LETTERS] #利用Ascall码性质将字符转为数字存在数组跟新状态######话说unordered_map也有这种性质但是我用他wa了一个点首先看到最多最长类似的字样首先想到的是深搜当然要注意回溯、本题简单就不多啰嗦看代码注释;######Code:```cpp#include#include#include# 题解列表 2024年09月15日 0 点赞 1 评论 540 浏览 评分:9.9
map哈希存储 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n) { if…… 题解列表 2024年09月15日 0 点赞 0 评论 381 浏览 评分:0.0
[LETTERS] BFS 配合 map容器 ##unordered_map的.count函数-用于查找是否出现过该状态,是返回1;```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN=1e7+10, 题解列表 2024年09月14日 0 点赞 1 评论 606 浏览 评分:9.9
筛素数最全模板 ###暴力筛素数(O(sqrt(n)))#include#includeusingnamespacestd;boolprimes(intx){if(x==2)returntrue;for(inti=2;i 题解列表 2024年09月14日 1 点赞 0 评论 567 浏览 评分:9.9 单调栈(可做模板) ##优化版(O(n))###手写栈版#include#includeusingnamespacestd;constintN=5000;inta[N],tt;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intn;cin 题解列表 2024年09月14日 1 点赞 0 评论 582 浏览 评分:9.9 [蓝桥杯2017年第八届真题-九宫幻方] DFS ##思路:先找出未用的数字有哪些,再进行深搜找出全排列的数,然后放入九宫格中,最后进行检测看是否符合题意```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN= 题解列表 2024年09月13日 0 点赞 1 评论 417 浏览 评分:9.9 « 12...140141142143144145146...16491650 »
单调栈(可做模板) ##优化版(O(n))###手写栈版#include#includeusingnamespacestd;constintN=5000;inta[N],tt;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intn;cin 题解列表 2024年09月14日 1 点赞 0 评论 582 浏览 评分:9.9
[蓝桥杯2017年第八届真题-九宫幻方] DFS ##思路:先找出未用的数字有哪些,再进行深搜找出全排列的数,然后放入九宫格中,最后进行检测看是否符合题意```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN= 题解列表 2024年09月13日 0 点赞 1 评论 417 浏览 评分:9.9