摘要:
思路 二分查找 1. 查找范围 取最大块的部分,设部分pie块的体积与最大快的体积比为R∈[0, 1],这样就包含的所有可能的情况。而且从1~0存在 单调性 ,按照题意找到第一个满足条件 的值即为最大值 2.判定条件 对于给定的体积求出总块数,总块数 给定快数则可行。 3.浮点数的离散化,区间大小为 阅读全文
摘要:
实现QQ新帐户申请和老帐户登陆的简化版功能。最大挑战是:据说现在的QQ号码已经有10位数了。 输入格式: 输入首先给出一个正整数N(≤),随后给出N行指令。每行指令的格式为:“命令符(空格)QQ号码(空格)密码”。其中命令符为“N”(代表New)时表示要新申请一个QQ号,后面是新帐户的号码和密码;命 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文
摘要:
欢迎评论(指正或是询问都可),谢谢大家 一、判断题 思路很正常的题目。 1-4反例:4个顶点只用3条边就可以做到全连通。所以边数可能等于顶点个数减一。错误。 二、选择题 2-8需要细心的做一下双旋操作, 2-12 C 设数字 {4371, 1323, 6173, 4199, 4344, 9679, 阅读全文
摘要:
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert 阅读全文