04 2017 档案
摘要:A prime number p≥2 is an integer which is evenly divisible by only two integers: 1 and p. A composite integer is one which is not prime. The fundament
阅读全文
摘要:InputThe first line of input consists of an integers T where 1≤T≤1000, the number of test cases. Then follow T lines, each containing four integers a,
阅读全文
摘要:Freddy practices various kinds of alternative medicine, such as homeopathy. This practice is based on the belief that successively diluting some subst
阅读全文
摘要:The factorial function, n! is defined thus for n a non-negative integer: 0! = 1 n! = n * (n-1)! (n > 0) We say that a divides b if there exists an int
阅读全文
摘要:Input The first line of input contains one integer, giving the number of operations to perform.Then follow the operations, one per line, each of the f
阅读全文
摘要:You start with a sequence of consecutive integers. You want to group them into sets. You are given the interval, and an integer P. Initially, each num
阅读全文
摘要:Given a sequence of positive integers, count all contiguous subsequences (sometimes called substrings, in contrast to subsequences, which may leave ou
阅读全文
摘要:The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room
阅读全文
摘要:题目意思就是已知n的阶乘,求n。 当输入的阶乘小于10位数的时候,我们可以用long long将字符串转化成数字,直接计算。 而当输入的阶乘很大的时候,我们就可以利用位数去大概的估计n。
阅读全文
摘要:We say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is
阅读全文
摘要:In the game of chess, the queen is a powerful piece. It can attack by moving any number of spaces in its current row, in its column or diagonally. In
阅读全文
摘要:题目1 : 智力竞赛 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi、小Ho还有被小Hi强拉来的小Z,准备组队参加一个智力竞赛。竞赛采用过关制,共计N个关卡。在第i个关卡中,小Hi他们需要获得Ai点分数才能够进入下一关。每一关的分数都是独立计算的,即使在一关当中获
阅读全文
摘要:题目1 : 机会渺茫 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi最近在追求一名学数学的女生小Z。小Z其实是想拒绝他的,但是找不到好的说辞,于是提出了这样的要求:对于给定的两个正整数N和M,小Hi随机选取一个N的约数N',小Z随机选取一个M的约数M',如果N'和
阅读全文