随笔分类 -  洛谷

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 21 下一页
摘要:Aimee 考试前看到某份考纲提到了平衡树 突发奇想想学一个 但是来不及了,为了平衡学习时间,以及大佬的建议下,毅然决定用vector搞一个 额,要是vector都过不了,那以我的水平,也拿不到更多的分了 配方,lower_bound+upper_bound+vector 对于操作1,使用vecto 阅读全文
posted @ 2020-11-03 19:39 Simex 阅读(86) 评论(0) 推荐(0)
摘要:Aimee 模板题也 关于递推式的证明 #include<iostream> #include<cstdio> #define int long long using namespace std; int n,m; int inv[3000005]; signed main(){ scanf("%l 阅读全文
posted @ 2020-11-02 21:39 Simex 阅读(88) 评论(0) 推荐(0)
摘要:Aimee 很简单的kmp小题目 设最小单元为s的话,显然$L>L_s$ 那么的话,假如给的串串为s+一个s的后半截,那么显然ne[end]会匹配到出现在完整串的位置 这样 L-ne[end]就是答案了 其余同理 #include<iostream> #include<cstring> #inclu 阅读全文
posted @ 2020-11-02 21:14 Simex 阅读(30) 评论(0) 推荐(0)
摘要:First Second 快速排序还是很重要的 #include<iostream> #include<cstdio> #include<algorithm> #include<cstdio> using namespace std; int zn[5000001]; int n,Aimee; vo 阅读全文
posted @ 2020-11-02 20:50 Simex 阅读(115) 评论(0) 推荐(0)
摘要:Aimee 很水的题目 只是为了练练手 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; int n; struct b{ double x; double y; 阅读全文
posted @ 2020-11-02 20:48 Simex 阅读(99) 评论(0) 推荐(0)
摘要:❤Aimee❤ 很有意思的题目 虽然说被我写的特别长 要做的事情就是先找到最大的点,然后找到与这个点相连的点中最大的那个 之后显然被选择的点只能在这两个中左右横跳。 有意思的是,这个写法并不需要特判n==1 #include<iostream> #include<cstdio> #include<c 阅读全文
posted @ 2020-10-31 22:34 Simex 阅读(191) 评论(0) 推荐(0)
摘要:Aimee 很简单的一个小题 分类讨论啊 --scz #include<iostream> #include<algorithm> #include<cstdio> #define int long long using namespace std; int q; int len[5]; signe 阅读全文
posted @ 2020-10-31 22:27 Simex 阅读(190) 评论(0) 推荐(0)
摘要:Aimee 一个很水的背包 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n; int dp[10001]; int num[10001]; int 阅读全文
posted @ 2020-10-31 20:00 Simex 阅读(93) 评论(0) 推荐(0)
摘要:Aimee 很简单的树上dp 一维就够了 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n; int x,y; int zn[160001]; struct e{ int to; int 阅读全文
posted @ 2020-10-31 18:57 Simex 阅读(87) 评论(0) 推荐(0)
摘要:Aimee 很简单的小dfs 额 其实是套着dfs壳的贪心 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,dis; int pl[100001]; int ans; void df 阅读全文
posted @ 2020-10-30 21:10 Simex 阅读(108) 评论(0) 推荐(0)
摘要:Aimee 很恶心的一道题 我们在考场上会遇到很多题,无论多难,都要大声喊出:"无所谓"。 怎么无所谓,有所谓 --scz 10分做法 爆搜 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using 阅读全文
posted @ 2020-10-28 20:24 Simex 阅读(127) 评论(1) 推荐(0)
摘要:Aimee 很水的题目 只要把P1144改一下 需要注意的是这个题有重边,求方案数的话一定要去重!! 这就涉及到很有趣的问题。 要想成为顶尖高手 就要做到滴水不漏 --橙汁哥 从这个题我才知道我写的堆优化Dijkstra复杂度有问题 TLE起飞 #include<iostream> #include 阅读全文
posted @ 2020-10-27 23:40 Simex 阅读(76) 评论(0) 推荐(0)
摘要:Aimee 这个题的数据范围$O(n^2)$ 过不去,但是这可是排列啊 求出一个数组中每一个元素在第二个中的位置,然后跑LIS ``cpp #include #include #include #include using namespace std; int p[100001]; int re[1 阅读全文
posted @ 2020-10-25 21:35 Simex 阅读(57) 评论(0) 推荐(0)
摘要:Miku 这个题很显然的可以从部分分推到正解 64 上去就是一个四维dp,dp[i][j][k][z]表示在第1行的时候第一行选了j个,第2行选了k个,第3行选了z个的 情况下的方案数,转移用手就能推。 只是有个小细节 #include<iostream> #include<cstdio> #inc 阅读全文
posted @ 2020-10-25 21:15 Simex 阅读(69) 评论(0) 推荐(0)
摘要:Miku 能够把自己的复杂的想法实现出来当然好 但是即使是一个复杂的,自以为正确的错误想法?? (被卡了半年有感) #include<iostream> #include<cstdio> using namespace std; int simex[30010]; int bo; int at[4] 阅读全文
posted @ 2020-10-23 23:30 Simex 阅读(133) 评论(0) 推荐(0)
摘要:Miku 很简单的线性dp 或者说不用dp 有两维,随便按照一维降序排个序,就成了个固定顺序的一维问题了。 直接$O(n^2)$贪心划分不下降子序列或者说运用dilworth定理,求最长上升子序列 贪心更快诶,可能是因为continue的多? dp #include<iostream> #inclu 阅读全文
posted @ 2020-10-22 23:27 Simex 阅读(127) 评论(0) 推荐(0)
摘要:Miku 很水的拓扑排序+dp 看错题除外。 这道题是要求有多少条食物链满足 左端是不会捕食其他生物的生产者,最右端是不会被其他生物捕食的消费 不是求最长的多长或者有几条最长!! (把一些无关紧要的变量起一些人名真有意思) #include<iostream> #include<queue> usi 阅读全文
posted @ 2020-10-21 23:24 Simex 阅读(67) 评论(0) 推荐(0)
摘要:MIku 这是一道数学题,可以推式子(我推错了) 这是一道dp,完全没想到它是。 所以说我把我的错误式子缝缝补补,加上个dfs 过了。 大体思想就是利用插板法求出每个盒子可以装几个球的方案, 然后因为同一个盒子内部的球是无序的,所以说用一点点排列的知识加上dfs的框架处理一下,然后就过了 #incl 阅读全文
posted @ 2020-10-20 23:44 Simex 阅读(107) 评论(0) 推荐(0)
摘要:Miku 推一个小式子就知道了 计算出最后的位置,然后从后往前比较。 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; long long last[100001]; long long n,m; 阅读全文
posted @ 2020-10-12 21:30 Simex 阅读(71) 评论(0) 推荐(0)
摘要:Miku 一个很简单的搜索 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n,m; int map[1001][1001];//地图 int vis 阅读全文
posted @ 2020-10-06 17:31 Simex 阅读(216) 评论(0) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 21 下一页