07 2021 档案

摘要:题目描述 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 梨花满地 阅读(72) 评论(0) 推荐(0)
摘要:问题: 一天,小 D 决定买一些糖果。他决定在两家不同的商店中买糖果,来体验更多的口味。 在每家商店中都有 n 颗糖果,每颗糖果都有一个权值:愉悦度,代表小 D觉得这种糖果有多好吃。其中,第一家商店中的第 i 颗糖果的愉悦度为 Ai,而第二家商店中的第 i 颗糖果的愉悦度为 Bi。 在每家商店买的糖 阅读全文
posted @ 2021-07-27 11:02 梨花满地 阅读(246) 评论(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 梨花满地 阅读(91) 评论(0) 推荐(0)
摘要:中石油大D:Go Fishing 求点(x, y)极坐标下的角度 double x = atan2(y, x);//此时的x是一个正切值 (atan2 返回以弧度表示的 y/x 的反正切) x * 180 / 3.14; #include<iostream> #include<cmath> #inc 阅读全文
posted @ 2021-07-20 22:25 梨花满地 阅读(356) 评论(0) 推荐(0)
摘要:输入a,b,c 题目:求给定数据范围[a,b]的前c小质因子的和, #include<iostream> #include<algorithm> #include<vector> using namespace std; const int N = 1e8 + 10; typedef long lo 阅读全文
posted @ 2021-07-20 20:51 梨花满地 阅读(44) 评论(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 梨花满地 阅读(59) 评论(0) 推荐(0)
摘要:0x01:位运算 计算a * b mod p 公式a * b = a * b - [a * b / p] * p 记 c = [a * b / p] x = a * b, y = c * p; ans = a - y #include<iostream> using namespace std; t 阅读全文
posted @ 2021-07-16 09:40 梨花满地 阅读(66) 评论(0) 推荐(0)