摘要: [gym101982M][思维好题][凸壳]Mobilization 题目链接 "20182019 acmicpc pacific northwest regional contest div 1 en.pdf" 题目大意 现在有$n$种士兵,每种士兵有一个血量$h_i$和潜力$p_i$以及花销$c 阅读全文
posted @ 2019-04-05 20:54 UnderSilence 阅读(332) 评论(0) 推荐(1) 编辑
摘要: [Gym101138G][容斥原理]LCM er 题意描述 给定$n,a,b,x$四个数字,需要计数满足如下条件序列的个数(答案对$10^9+7$取模),条件如下。 $$ {a \le A_1 \le A_2 \le A_3 \le A_4 \le \cdots \le A_n \le b }\\ 阅读全文
posted @ 2019-04-05 00:28 UnderSilence 阅读(281) 评论(0) 推荐(0) 编辑
摘要: [HDU6304][数学] Chiaki Sequence Revisited 杭电多校2018第一场G 题目描述 现在抛给你一个数列$A$ $$ a_n=\begin{cases}1 & n = 1,2 \\ a_{n a_{n 1}} + a_{n 1 a_{n 2}} & n \ge 3\en 阅读全文
posted @ 2018-07-24 17:29 UnderSilence 阅读(1384) 评论(2) 推荐(4) 编辑
摘要: 希望每一题都可以深入理解 、吃透 OJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094)初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2 阅读全文
posted @ 2017-11-03 10:45 UnderSilence 阅读(287) 评论(2) 推荐(1) 编辑
摘要: #include using namespace std; double alldead[12][105]; double rev[12][105]; double p[12][105]; double ans[12]; int a[12]; int T, n; double fastpow(double a, int b) { double ret = 1.0; whil... 阅读全文
posted @ 2017-11-02 19:29 UnderSilence 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 只要保存每相邻两行字符串 第一个不同位 即可。然后按照 第一个不同位上的字符有: " 来自下一行的 大于 来自上一行的" 构图,跑拓扑排序即可。 当然要判断一下有没有环构成, 有环一定是NO(可以思考一下)。 还可以提前判断下一行是不是上一行的前缀, 如果是,那么一定是NO。 在拓扑排序的过程中保存 阅读全文
posted @ 2017-10-17 20:17 UnderSilence 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 原题: BZOJ1032 (原题数据有问题) 阅读全文
posted @ 2017-09-19 15:37 UnderSilence 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 有点麻烦.. 阅读全文
posted @ 2017-08-18 03:43 UnderSilence 阅读(149) 评论(0) 推荐(0) 编辑
摘要: /*hdu6134[莫比乌斯反演] 2017多校8*/ #include using namespace std; typedef long long LL; const LL MOD = 1000000007; const int maxn = 1000000 + 5; LL f[maxn], g[maxn], d[maxn]; bool vis[maxn]; int prime[ma... 阅读全文
posted @ 2017-08-18 03:09 UnderSilence 阅读(201) 评论(0) 推荐(1) 编辑
摘要: #include using namespace std; int n, k; const int MOD = 1000000007; int a[105], cnt[5]; void solve() { int t; cnt[4]=n,cnt[2]=2*n; for(int i=0;i> n >> k; for (int i = 0; i > a[i]; ... 阅读全文
posted @ 2017-08-14 14:49 UnderSilence 阅读(117) 评论(0) 推荐(0) 编辑