随笔分类 - OJ -- POJ
摘要:Description Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest
阅读全文
摘要:Description 传说中的暗之连锁被人们称为 Dark。 Dark 是人类内心的黑暗的产物,古今中外的勇者们都试图打倒它。经过研究,你发现 Dark 呈现无向图的结构,图中有 N 个节点和两类边,一类边被称为主要边,而另一类被称为附加边。 Dark 有 N – 1条主要边,并且 Dark 的任
阅读全文
摘要:Description 给出一个初始序列A1,A2,...,An,要求你编写程序支持如下操作: 1. ADD x y D:给子序列Ax...Ay的每个元素都加上D。例如对1,2, 3,4,5执行"ADD 2 4 1" 会得到1,3,4,5,5。 2. REVERSE x y:将子序列Ax...Ay翻
阅读全文
摘要:Description 囧囧有个囧盒,可以处理一些很囧的事情。这个囧盒一开始是空的,可以处理2种操作: Add(X):将元素X放入囧盒。 Get:第I次调用Get的时候,输出囧盒里面第I小的数。下面是囧囧操作的一个例子: | N(按升序排列) | 操作 | Get调用次数 | 囧盒的内容 | 输出
阅读全文
摘要:Description Beads of N colors are connected together into a circular necklace of N beads (N include include include include define inf 0x7f7f7f7f usin
阅读全文
摘要:Description Urej loves to play various types of dull games. He usually asks other people to play with him. He says that playing those games can show h
阅读全文
摘要:Description Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows:The starting position has a n
阅读全文
摘要:Description Nim is a 2 player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removi
阅读全文
摘要:Description As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Schedulin
阅读全文
摘要:Description The little cat takes over the management of a new park. There is a large circular statue in the center of the park, surrounded by N pots o
阅读全文
摘要:Description Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, "Can yo
阅读全文