cychester

2018年10月18日

Luogu3119 草鉴定-Tarjan+Topsort

摘要: Solution 简单的$Tarjan$题。 有大佬现成博客 就不写了 → 传送门 Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<queue> 5 #define rd read() 6 us 阅读全文

posted @ 2018-10-18 16:33 cychester 阅读(186) 评论(0) 推荐(0) 编辑

Luogu1613 跑路-倍增+Floyd

摘要: Solution 挺有趣的一道题, 仔细想想才想出来 先用$mp[i][j][dis]$ 是否存在一条 $i$ 到 $j$ 的长度为 $2^{dis}$ 的路径。 转移 : 若$mp[i][j][dis] = 1$, 则把 $f[i][j]$ 记为$1$ 然后再用$f[i][j]$ 去跑$Floyd 阅读全文

posted @ 2018-10-18 12:29 cychester 阅读(100) 评论(0) 推荐(0) 编辑

Luogu2022 有趣的数-二分答案+数位DP

摘要: Solution 我好像写了一个非常有趣的解法233, 我们可以用数位$DP$ 算出比$N$小的数中 字典序比 $X$ 小的数有多少个, 再和 $rank$进行比较。 由于具有单调性, 显然可以二分答案。 Code 1 #include<cstdio> 2 #include<cstring> 3 # 阅读全文

posted @ 2018-10-18 10:18 cychester 阅读(281) 评论(2) 推荐(0) 编辑

导航