摘要: 题目描述: 分析: b[1]就是最大顾客数量。然后求盈利的前缀和,从大到小取即可。 在取盈利的过程中记录用掉的份数以及最小份数的下标,不断前移即可。 但是,这题要用高精度,因为会爆long long; 用long double 和 Python 也能水过。 代码如下: #include<bits/s 阅读全文
posted @ 2020-08-04 15:42 mdID(WWWZZZQQQ) 阅读(133) 评论(0) 推荐(0)
摘要: 题目描述: 自行解决。 分析: 一个森林内部节点的度数平方和等于 2 * (长度为 2 的路径数+长度为 3 的路径数)。 n 个点的带标号树个数为n n−2 • 我们可以通过一个 n 2 的做法得到 n 个点的带标号森林个数。 我们分别统计长度为 2 的路径的贡献, 相当于从 n 个点里面挑出 2 阅读全文
posted @ 2020-08-02 20:22 mdID(WWWZZZQQQ) 阅读(175) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5672/H来源:牛客网 题目描述: The following rules define a kind of integer tuple - the Legend Tuple: (1, k) is always a Le 阅读全文
posted @ 2020-08-02 20:06 mdID(WWWZZZQQQ) 阅读(324) 评论(0) 推荐(0)
摘要: 题目描述 : 链接:https://ac.nowcoder.com/acm/contest/5672/G来源:牛客网 Now we start to describe a kind of directed graph called the Drying Rack Graph (DRG) with a 阅读全文
posted @ 2020-08-02 19:59 mdID(WWWZZZQQQ) 阅读(219) 评论(0) 推荐(0)
摘要: 题目描述 : Nowadays, the Kingdom of Dreamgrid is suffering from a national pandemic. Fortunately,president Baobao is working effectively with the Center f 阅读全文
posted @ 2020-08-02 19:47 mdID(WWWZZZQQQ) 阅读(198) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5671/G来源:牛客网 题目描述: Roundgod draws a grid graph of size nnn with n×nn \times nn×n cells. She can use one of kkk 阅读全文
posted @ 2020-07-28 15:53 mdID(WWWZZZQQQ) 阅读(146) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5671/H来源:牛客网 题目描述 Roundgod is obsessive about numbers. Let S(x)S(x)S(x) be the sum of the digits of xxx in deci 阅读全文
posted @ 2020-07-28 14:00 mdID(WWWZZZQQQ) 阅读(322) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5671/B来源:牛客网 题目描述: Roundgod is obsessive about linear algebra. Let A={0,1}A=\{0,1\}A={0,1}, everyday she will g 阅读全文
posted @ 2020-07-27 21:46 mdID(WWWZZZQQQ) 阅读(384) 评论(0) 推荐(0)
摘要: 题目描述: 链接:https://ac.nowcoder.com/acm/contest/5671/K来源:牛客网A sequence is called kkk-bag, if and only if it is put in order by some (maybe one) permutati 阅读全文
posted @ 2020-07-27 20:32 mdID(WWWZZZQQQ) 阅读(515) 评论(0) 推荐(0)
摘要: 题目描述: Mr. W got a new graph with N vertices and N - 1 edges. It's a connected graph without cycles. Each edge should have an ugly value. To make the g 阅读全文
posted @ 2020-07-26 15:27 mdID(WWWZZZQQQ) 阅读(222) 评论(0) 推荐(0)