[暑假集训--数论]poj2115 C Looooops
摘要:A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement; I.e., a loop which st
阅读全文
posted @
2017-08-04 15:42
zhber
阅读(221)
推荐(0)
[暑假集训--数论]poj3518 Prime Gap
摘要:The sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numbe
阅读全文
posted @
2017-08-04 15:24
zhber
阅读(163)
推荐(0)
[暑假集训--数论]poj1730 Perfect Pth Powers
摘要:We say that x is a perfect square if, for some integer b, x = b 2. Similarly, x is a perfect cube if, for some integer b, x = b 3. More generally, x i
阅读全文
posted @
2017-08-04 15:22
zhber
阅读(159)
推荐(0)
[暑假集训--数论]poj2142 The Balance
摘要:Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300m
阅读全文
posted @
2017-08-04 15:15
zhber
阅读(171)
推荐(0)
[暑假集训--数论]poj2773 Happy 2006
摘要:Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all rela
阅读全文
posted @
2017-08-04 15:10
zhber
阅读(182)
推荐(0)
[暑假集训--数论]poj1061 青蛙的约会
摘要:Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某
阅读全文
posted @
2017-08-04 14:54
zhber
阅读(160)
推荐(1)
[暑假集训--数论]poj2657 Comfort
摘要:Description A game-board consists of N fields placed around a circle. Fields are successively numbered from1 to N clockwise. In some fields there may
阅读全文
posted @
2017-08-04 14:09
zhber
阅读(146)
推荐(0)
cf711E ZS and The Birthday Paradox
摘要:ZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that given a random set of 23 people, there is around 50
阅读全文
posted @
2017-08-04 11:10
zhber
阅读(273)
推荐(0)
cf493E Vasya and Polynomial
摘要:Vasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function P(x) = a0 + a1x1
阅读全文
posted @
2017-08-04 10:06
zhber
阅读(294)
推荐(0)
cf396B On Sum of Fractions
摘要:Let's assume that v(n) is the largest prime number, that does not exceed n; u(n) is the smallest prime number strictly greater than n. Find . Let's as
阅读全文
posted @
2017-08-04 09:52
zhber
阅读(349)
推荐(0)
Spoj-ODDDIV Odd Numbers of Divisors
摘要:Given a positive odd integer K and two positive integers low and high, determine how many integers between low and high contain exactly K divisors. In
阅读全文
posted @
2017-07-24 16:43
zhber
阅读(315)
推荐(0)
Spoj-ANTP Mr. Ant & His Problem
摘要:Mr. Ant has 3 boxes and the infinite number of marbles. Now he wants to know the number of ways he can put marbles in these three boxes when the follo
阅读全文
posted @
2017-07-15 12:19
zhber
阅读(201)
推荐(0)
cf575A Fibonotci
摘要:Fibonotci sequence is an integer recursive sequence defined by the recurrence relation Fn = sn - 1·Fn - 1 + sn - 2·Fn - 2withF0 = 0, F1 = 1 Sequence s
阅读全文
posted @
2017-07-14 22:13
zhber
阅读(813)
推荐(0)
cf660E Different Subsets For All Tuples
摘要:For a sequence a of n integers between 1 and m, inclusive, denote f(a) as the number of distinct subsequences of a (including the empty subsequence).
阅读全文
posted @
2017-07-14 19:34
zhber
阅读(269)
推荐(0)
cf615D Multipliers
摘要:Ayrat has number n, represented as it's prime factorization pi of size m, i.e. n = p1·p2·...·pm. Ayrat got secret information that that the product of
阅读全文
posted @
2017-07-12 00:11
zhber
阅读(785)
推荐(0)
cf487C Prefix Product Sequence
摘要:Consider a sequence [a1, a2, ... , an]. Define its prefix product sequence . Now given n, find a permutation of [1, 2, ..., n], such that its prefix p
阅读全文
posted @
2017-07-11 23:12
zhber
阅读(241)
推荐(0)
Spoj-TRNGL Make Triangle
摘要:Make Triangle Chayanika loves Mathematics. She is learning a new chapter geometry. While reading the chapter a question came in her mind. Given a conv
阅读全文
posted @
2017-07-11 22:26
zhber
阅读(254)
推荐(0)
bzoj1965 [Ahoi2005]SHUFFLE 洗牌
摘要:Description为了表彰小联为Samuel星球的探险所做出的贡献,小联被邀请参加Samuel星球近距离载人探险活动。 由于Samuel星球相当遥远,科学家们要在飞船中度过相当长的一段时间,小联提议用扑克牌打发长途旅行中的无聊时间。玩了几局之后,大家觉得单纯玩扑克牌对于像他们这样的高智商人才来说...
阅读全文
posted @
2015-01-10 22:28
zhber
阅读(388)
推荐(0)
bzoj2822 [AHOI2012]树屋阶梯
摘要:Description暑假期间,小龙报名了一个模拟野外生存作战训练班来锻炼体魄,训练的第一个晚上,教官就给他们出了个难题。由于地上露营湿气重,必须选择在高处的树屋露营。小龙分配的树屋建立在一颗高度为N+1尺(N为正整数)的大树上,正当他发愁怎么爬上去的时候,发现旁边堆满了一些空心四方钢材(如图1.1...
阅读全文
posted @
2014-12-23 20:58
zhber
阅读(221)
推荐(0)
bzoj1485 [HNOI2009]有趣的数列
摘要:Description我们称一个长度为2n的数列是有趣的,当且仅当该数列满足以下三个条件:(1)它是从1到2n共2n个整数的一个排列{ai};(2)所有的奇数项满足a1=2i。这个很好yy,因为我们考虑的是偶数位的排列,前面肯定还有奇数位的数,而且大小比它小。前面的偶数位的数都比它小,前面奇数位的数...
阅读全文
posted @
2014-12-23 20:56
zhber
阅读(970)
推荐(0)