摘要: 思路 二分查找 1. 查找范围 取最大块的部分,设部分pie块的体积与最大快的体积比为R∈[0, 1],这样就包含的所有可能的情况。而且从1~0存在 单调性 ,按照题意找到第一个满足条件 的值即为最大值 2.判定条件 对于给定的体积求出总块数,总块数 给定快数则可行。 3.浮点数的离散化,区间大小为 阅读全文
posted @ 2019-08-12 17:37 Acoccus 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 实现QQ新帐户申请和老帐户登陆的简化版功能。最大挑战是:据说现在的QQ号码已经有10位数了。 输入格式: 输入首先给出一个正整数N(≤),随后给出N行指令。每行指令的格式为:“命令符(空格)QQ号码(空格)密码”。其中命令符为“N”(代表New)时表示要新申请一个QQ号,后面是新帐户的号码和密码;命 阅读全文
posted @ 2019-06-08 15:33 Acoccus 阅读(449) 评论(0) 推荐(0) 编辑
摘要: Given a hash table of size N, we can define a hash function (. Suppose that the linear probing is used to solve collisions, we can easily obtain the s 阅读全文
posted @ 2019-06-06 11:34 Acoccus 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha 阅读全文
posted @ 2019-06-02 09:45 Acoccus 阅读(168) 评论(0) 推荐(1) 编辑
摘要: The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist 阅读全文
posted @ 2019-05-31 23:26 Acoccus 阅读(164) 评论(0) 推荐(0) 编辑
摘要: According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文
posted @ 2019-05-31 21:11 Acoccus 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 欢迎评论(指正或是询问都可),谢谢大家 一、判断题 思路很正常的题目。 1-4反例:4个顶点只用3条边就可以做到全连通。所以边数可能等于顶点个数减一。错误。 二、选择题 2-8需要细心的做一下双旋操作, 2-12 C 设数字 {4371, 1323, 6173, 4199, 4344, 9679, 阅读全文
posted @ 2019-05-31 19:18 Acoccus 阅读(2577) 评论(0) 推荐(0) 编辑
摘要: According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文
posted @ 2019-05-31 08:10 Acoccus 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 10-5 10-6 11-1 11-2 11-3 11-4 KMP 阅读全文
posted @ 2019-05-28 10:48 Acoccus 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 给定公司N名员工的工龄,要求按工龄增序输出每个工龄段有多少员工。 输入格式: 输入首先给出正整数N(≤),即员工总人数;随后给出N个整数,即每个员工的工龄,范围在[0, 50]。 输出格式: 按工龄的递增顺序输出每个工龄的员工个数,格式为:“工龄:人数”。每项占一行。如果人数为0则不输出该项。 输入 阅读全文
posted @ 2019-05-28 10:40 Acoccus 阅读(155) 评论(0) 推荐(0) 编辑