随笔分类 -  2020_7_16

暑假集训
摘要:The cows are in a particularly mischievous mood today! All Farmer John wants to do is take a photograph of the cows standing in a line, but they keep 阅读全文
posted @ 2021-08-04 21:25 梨花满地 阅读(86) 评论(0) 推荐(0)
摘要:题目描述 Bessie the cow is getting bored of the milk production industry, and wants to switch to an exciting new career in computing. To improve her codin 阅读全文
posted @ 2021-07-30 17:26 梨花满地 阅读(61) 评论(0) 推荐(0)
摘要:问题: 一天,小 D 决定买一些糖果。他决定在两家不同的商店中买糖果,来体验更多的口味。 在每家商店中都有 n 颗糖果,每颗糖果都有一个权值:愉悦度,代表小 D觉得这种糖果有多好吃。其中,第一家商店中的第 i 颗糖果的愉悦度为 Ai,而第二家商店中的第 i 颗糖果的愉悦度为 Bi。 在每家商店买的糖 阅读全文
posted @ 2021-07-27 11:02 梨花满地 阅读(234) 评论(0) 推荐(0)
摘要:解题思路 使用二分来对朴素版动态规划进行优化 当这个数a[i]比当前f最后一个数f[cnt]还要大时,那么这个数就符合条件f[cnt++] = a[i] 否则 就在f数组里面找第一个比a[i]大的数, 把a[i] 替换给这个位置 毕竟1 5 6 和1 4 6 总是1 4 6 可能性更高一些 比如 2 阅读全文
posted @ 2021-07-23 20:12 梨花满地 阅读(75) 评论(0) 推荐(0)
摘要:const int N = 1e5; int e[N], ne[N], h, idx;//结点存储的值, 下一个结点的下标, 第一个结点的位置, 链表末尾(空)的结点下标 void init() { h = -1; } void add_to_head(int x) { e[idx] = x; ne 阅读全文
posted @ 2021-07-17 16:49 梨花满地 阅读(50) 评论(0) 推荐(0)