随笔分类 -  vjudge

摘要:Aimee 很显然的做法就是枚举每个点为源点然后树形dp \[ d_s[x]=\sum_{y\in son(x)} \left\{ \begin{aligned} min((D_s[y],c(x,y)))\quad degeree_y>1 \\ c(x,y) \quad\quad\quad\quad 阅读全文
posted @ 2021-06-20 16:33 Simex 阅读(63) 评论(0) 推荐(0)
摘要:Miku 首先我们要知道,如果一个毛虫死亡的概率是P,那么两个毛球死亡概率就是$p^2$ 然后对于定义dp[i]表示一只毛球死在i天的可能性,就可以得到递推式 \(dp_i=p_0+p_1*dp_{i-1}+p_2*(dp_{i-1})^2+····p_{n-1}*(dp_i-1)^{n-1}\) 阅读全文
posted @ 2020-10-02 23:32 Simex 阅读(106) 评论(0) 推荐(0)
摘要:这个合并果子版的题和哈夫曼树极为相似 Miku #include<iostream> #include<cstdio> #include<algorithm> #include<queue> using namespace std; priority_queue <long long> q; lon 阅读全文
posted @ 2020-10-02 23:16 Simex 阅读(106) 评论(0) 推荐(0)
摘要:Miku 这道题样例错了!!! 正确解决方法 ⇒ 写一个搜索 ⇒ TLE ⇒进行记忆化改造 ⇒ Ac #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int maxn =15; c 阅读全文
posted @ 2020-08-13 22:03 Simex 阅读(94) 评论(0) 推荐(0)
摘要:Miku 这个题目还是挺水得 正确解决方法 \(\Rightarrow\) 写一个搜索 \(\Rightarrow\) TLE $\Rightarrow$进行记忆化改造 \(\Rightarrow\) Ac 记忆化搜索和dp个人感觉有个区别就是记忆化是从下往上,dp是从上往下 #include<io 阅读全文
posted @ 2020-08-13 20:20 Simex 阅读(122) 评论(0) 推荐(0)
摘要:Miku 第一关键字是温度,那完全可以在保证图联通的前提下找到最大的最小温度 最小生成树 然后把所有比最小温度还小的边建成一个新图,跑最短路就行了 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #inc 阅读全文
posted @ 2020-08-06 13:31 Simex 阅读(67) 评论(0) 推荐(0)
摘要:Miku 三分答案这东西,非常好理解 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n; double y; double xz=1e-7;//修正精度 double lm,rm; d 阅读全文
posted @ 2020-08-04 20:22 Simex 阅读(80) 评论(0) 推荐(0)
摘要:链接:Miku 思路简单,双向bfs,实现困难 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; const int maxn=100003; int f,an 阅读全文
posted @ 2020-07-31 18:36 Simex 阅读(141) 评论(0) 推荐(0)
摘要:链接:Miku 大佬的证明 我的代码 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<map> using namespace std; char aim[1500001]; int 阅读全文
posted @ 2020-07-30 16:26 Simex 阅读(155) 评论(0) 推荐(0)
摘要:这就是一个博弈论 题目:Miku 这道题我们既可以找规律:如果N是三的倍数,C就赢了,并且我们也可以用SG函数 好,那么怎么用SG函数实现呢,首先确定边界。 如果当前人面前有0个石子,那么显然他输了对吧(最后一个一定被上个人拿走了) 那么SG[0]=0;(我用0表示当前人必败,1必胜0) 那么其他情 阅读全文
posted @ 2020-07-18 14:56 Simex 阅读(159) 评论(0) 推荐(0)
摘要:扫描线求周长 链接(HDU):Miku 链接(Vjudge):Miku HDU是多组数据!!!而且不写明白了!!! 我本以为既然多组数据,何不写上一共几组,既然不写,那必然是不存在了 但是它就是多组数据 这道题显然的做法是扫描两次,横着一次竖着一次,不过会很繁琐 事实上,一次就够了 完全可以从上向下 阅读全文
posted @ 2020-03-14 08:11 Simex 阅读(366) 评论(5) 推荐(0)
摘要:链接:Miku 没有UVa账号唉 卡了蒟蒻一天,因为漏掉了懒标记的下放。 线段树的巨大码量,为bug提供了绝佳的掩护 写完后,我哭了 人间的喜悦就这么简单吧 对于一个矩阵,有两个操作,子矩阵加v或者子矩阵变为v 询问子矩阵最大值,最小值和和 最简单的想法是线段树,不过太难实现了(对于本蒟蒻),所以说 阅读全文
posted @ 2020-02-28 17:30 Simex 阅读(342) 评论(0) 推荐(0)