cf359D Pair of Numbers
摘要:Simon has an array a1, a2, ..., an, consisting of n positive integers. Today Simon asked you to find a pair of integers l, r (1 ≤ l ≤ r ≤ n), such tha
阅读全文
posted @
2017-08-04 13:09
zhber
阅读(241)
推荐(0)
cf449C Jzzhu and Apples
摘要:Jzzhu has picked n apples from his big apple tree. All the apples are numbered from 1 to n. Now he wants to sell them to an apple store. Jzzhu will pa
阅读全文
posted @
2017-08-04 10:47
zhber
阅读(240)
推荐(0)
cf725F Family Photos
摘要:Alice and Bonnie are sisters, but they don't like each other very much. So when some old family photos were found in the attic, they started to argue
阅读全文
posted @
2017-08-04 10:30
zhber
阅读(313)
推荐(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
阅读(313)
推荐(0)
Spoj-BIPCSMR16 Team Building
摘要:To make competitive programmers of BUBT, authority decide to take regular programming contest. To make this contest more competitive and fruitful ther
阅读全文
posted @
2017-07-15 12:07
zhber
阅读(264)
推荐(0)
cf468C Hack it!
摘要:Little X has met the following problem recently. Let's define f(x) as the sum of digits in decimal representation of number x (for example, f(1234) =
阅读全文
posted @
2017-07-14 00:14
zhber
阅读(421)
推荐(0)
cf682E Alyona and Triangles
摘要:You are given n points with integer coordinates on the plane. Points are given in a way such that there is no triangle, formed by any three of these n
阅读全文
posted @
2017-07-11 23:23
zhber
阅读(1550)
推荐(0)
cf550D Regular Bridge
摘要:Regular Bridge An undirected graph is called k-regular, if the degrees of all its vertices are equal k. An edge of a connected graph is called a bridg
阅读全文
posted @
2017-07-11 22:40
zhber
阅读(231)
推荐(0)
cf590A Median Smoothing
摘要:A. Median Smoothingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA schoolboy named Vasya loves...
阅读全文
posted @
2015-11-01 00:16
zhber
阅读(309)
推荐(0)
2015.9.11模拟赛 codevs4162 bzoj1774【无双大王】
摘要:题目描述 Description 无双大王hzwer扫清六合,席卷八荒,万姓倾心,四方仰德。 hzwer拥有一片领土,其中有n个城市和m条双向道路。他规定每个人在领土上行走都要交过路费,同时进城也要交进城费。不同道路的过路费可能不同,不同城市的进城费可能不同。但是hzwer规定,如果缴纳x的进城费,
阅读全文
posted @
2015-09-11 22:48
zhber
阅读(215)
推荐(0)
bzoj3450 Tyvj1952 Easy
摘要:Description某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:(我们来简化一下这个游戏的规则有n次点击要做,成功了就是o,失败了就是x,分数是按comb计算的,连续a个comb就有a*a分,comb就是极大的连续o。比如ooxxxxooooxxx,分数就是2*2+4*...
阅读全文
posted @
2015-01-10 22:45
zhber
阅读(189)
推荐(0)
bzoj1965 [Ahoi2005]SHUFFLE 洗牌
摘要:Description为了表彰小联为Samuel星球的探险所做出的贡献,小联被邀请参加Samuel星球近距离载人探险活动。 由于Samuel星球相当遥远,科学家们要在飞船中度过相当长的一段时间,小联提议用扑克牌打发长途旅行中的无聊时间。玩了几局之后,大家觉得单纯玩扑克牌对于像他们这样的高智商人才来说...
阅读全文
posted @
2015-01-10 22:28
zhber
阅读(385)
推荐(0)
cf500D New Year Santa Network
摘要:D. New Year Santa Networktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNew Year is coming in T...
阅读全文
posted @
2014-12-31 20:57
zhber
阅读(313)
推荐(0)
bzoj1081 [SCOI2005]超级格雷码
摘要:Description著名的格雷码是指2n个不同n位二进制数(即0~2n-1,不足n位在前补零)的一个排列,这个排列满足相邻的两个二进制数的n位数字中最多只有一个数字不同(例如003和001就有一个数位不同,而003和030有两个数位不同,不符合条件)。例如n=2时,(00,01,11,10)就是一...
阅读全文
posted @
2014-12-24 19:37
zhber
阅读(433)
推荐(0)
cf493D Vasya and Chess
摘要:D. Vasya and Chesstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya decided to learn to play...
阅读全文
posted @
2014-12-04 09:02
zhber
阅读(631)
推荐(0)
cf492E Vanya and Field
摘要:E. Vanya and Fieldtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya decided to walk in the f...
阅读全文
posted @
2014-12-02 08:05
zhber
阅读(232)
推荐(0)
bzoj1060 [ZJOI2007]时态同步
摘要:Description小Q在电子工艺实习课上学习焊接电路板。一块电路板由若干个元件组成,我们不妨称之为节点,并将其用数字1,2,3….进行标号。电路板的各个节点由若干不相交的导线相连接,且对于电路板的任何两个节点,都存在且仅存在一条通路(通路指连接两个元件的导线序列)。在电路板上存在一个特殊的元件称...
阅读全文
posted @
2014-11-30 11:54
zhber
阅读(181)
推荐(0)
bzoj3626 [LNOI2014]LCA
摘要:Description给出一个n个节点的有根树(编号为0到n-1,根节点为0)。一个点的深度定义为这个节点到根的距离+1。设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。有q次询问,每次询问给出l r z,求sigma_{l#include#include#include#i...
阅读全文
posted @
2014-11-28 16:34
zhber
阅读(349)
推荐(0)
bzoj1303 [CQOI2009]中位数图
摘要:Description给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b。中位数是指把所有元素从小到大排列后,位于中间的数。Input第一行为两个正整数n和b ,第二行为1~n 的排列。Output输出一个整数,即中位数为b的连续子序列个数。Sample Input7 45 ...
阅读全文
posted @
2014-11-23 16:33
zhber
阅读(426)
推荐(0)
bzoj3721 [PA2014 Final] Bazarek
摘要:Description有n件商品,选出其中的k个,要求它们的总价为奇数,求最大可能的总价。Input第一行一个整数n(1#include#include#include#include#include#include#include#include#include#include#define LL...
阅读全文
posted @
2014-11-23 15:10
zhber
阅读(206)
推荐(0)