上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页

P1352 没有上司的舞会

摘要: 链接:https://www.luogu.com.cn/problem/P1352 树形dp板子,感觉很巧妙,利用01表示是否取 代码: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include 阅读全文
posted @ 2024-05-10 17:10 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

D. Flipper

摘要: 链接:https://codeforces.com/problemset/problem/1833/D 题面: 细节:分类讨论 约定记号:a,b[c,d],e,f:选定cd为反向序列。 ①当最大值出现在最后一个元素 可以确定:必然的形式是[a,...,p],maxn,右括号位置一定不变,那么就移动左 阅读全文
posted @ 2024-05-10 15:51 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

CF1773E Easy Assembly

摘要: 链接:https://codeforces.com/problemset/problem/1773/E 思路 首先先得出最终序列,因为它具有唯一性,然后再根据其中的前后关系来判断原来的数列需要切几刀。然后再根据切几刀形成的最终数列判断需要合并几次。 例如: 目标数列是ABCDEF,而给出的某两段序列 阅读全文
posted @ 2024-05-10 13:55 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

P2341 [USACO03FALL / HAOI2006] 受欢迎的牛 G

摘要: 链接:https://www.luogu.com.cn/problem/P2341 题目: 思路: tarjan缩点:把所有强连通分量缩成一个点,然后统计出度为0的缩点,如果只有一个,那么能成为明星的数量就是该缩点扩充后的个数;如果不止一个,那就是0. 代码: 额,就是不知道为什么debug了两节课 阅读全文
posted @ 2024-05-09 11:46 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

Tarjan模板

摘要: Tarjan模板 #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #include<string.h> #include<ioman 阅读全文
posted @ 2024-05-09 09:57 WHUStar 阅读(4) 评论(0) 推荐(0) 编辑

P3388【模板】割点(割顶)

摘要: https://www.luogu.com.cn/problem/P3388 求割点模板 #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<strin 阅读全文
posted @ 2024-05-09 09:28 WHUStar 阅读(8) 评论(0) 推荐(0) 编辑

P3916 图的遍历

摘要: 题面: 链接:https://www.luogu.com.cn/problem/P3916 思路:反向遍历图 啊卡了好久,如果正序来的话还得考虑环和先后次序的问题 代码: #include<iostream> #include<vector> #include<algorithm> #include 阅读全文
posted @ 2024-05-08 17:24 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

1. 实战7.4HDU1710-由先序和中序序列产生后序序列

摘要: 希冀平台: 代码: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #include<string.h> #include<ioma 阅读全文
posted @ 2024-05-07 11:46 WHUStar 阅读(11) 评论(0) 推荐(0) 编辑

D. Wooden Toy Festival

摘要: 链接:https://codeforces.com/problemset/problem/1840/D 洛谷链接:https://www.luogu.com.cn/problem/CF1840D 思路: 这个题目之前好像碰到过类似的,感觉就是对长度二分,然后遍历,注意有个坑的点在于应该是2*len因 阅读全文
posted @ 2024-05-06 20:45 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

C. Game on Permutation

摘要: 链接:https://codeforces.com/problemset/problem/1860/C 洛谷链接:https://www.luogu.com.cn/problem/CF1860C 相关知识点复习:LIS最长上升子序列 链接:https://blog.csdn.net/lxt_Luci 阅读全文
posted @ 2024-05-05 19:10 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页