上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 50 下一页
摘要: Problem Description The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the ge 阅读全文
posted @ 2018-08-21 23:29 霜雪千年 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you 阅读全文
posted @ 2018-08-20 23:50 霜雪千年 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Problem Description 有一台机器,并且给你这台机器的工作表,工作表上有n个任务,机器在ti时间执行第i个任务,1秒即可完成1个任务。有m个询问,每个询问有一个数字q,表示如果在q时间有一个工作表之外的任务请求,请计算何时这个任务才能被执行。机器总是按照工作表执行,当机器空闲时立即执 阅读全文
posted @ 2018-08-20 23:30 霜雪千年 阅读(240) 评论(0) 推荐(0) 编辑
摘要: J-plan(贪心) 题目描述 There are n students going to travel. And hotel has two types room:double room and triple room. The price of a double room is p2 and t 阅读全文
posted @ 2018-08-19 20:56 霜雪千年 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 描述 现在有"abcdefghijkl”12个字符,将其所有的排列中按字典序排列,给出任意一种排列,说出这个排列在所有的排列中是第几小的? 输入 第一行有一个整数n(0<n<=10000);随后有n行,每行是一个排列; 输出 输出一个整数m,占一行,m表示排列是第几位; 样例输入 样例输出 解题思路 阅读全文
posted @ 2018-08-17 16:47 霜雪千年 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 描述 现在有"abcdefghijkl”12个字符,将其按字典序排列,如果给出任意一种排列,我们能说出这个排列在所有的排列中是第几小的。但是现在我们给出它是第几小,需要你求出它所代表的序列. 输入 第一行有一个整数n(0<n<=10000);随后有n行,每行是一个整数m,它代表着序列的第几小; 输出 阅读全文
posted @ 2018-08-17 16:25 霜雪千年 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Description The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number t 阅读全文
posted @ 2018-08-17 10:33 霜雪千年 阅读(216) 评论(2) 推荐(0) 编辑
摘要: Problem Description A positive proper divisor is a positive divisor of a number n, excluding n itself. For example, 1, 2, and 3 are positive proper di 阅读全文
posted @ 2018-08-17 08:00 霜雪千年 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Description Write a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a nat 阅读全文
posted @ 2018-08-17 07:52 霜雪千年 阅读(778) 评论(0) 推荐(0) 编辑
摘要: 素数的定义:除了1和它本身之外,不能被其他整数整除。 一、判定一个正整数n是否为素数的方法: ①定义法:枚举2~n-1这n-2个正整数,如果它们均不能整除n,则可断定n为素数。代码如下:时间复杂度为O(n),如果n为10^9,就不能用此方法。 ②从2开始枚举到不大于sqrt(n)的所有正整数,如果它 阅读全文
posted @ 2018-08-16 16:47 霜雪千年 阅读(825) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 50 下一页