
贪心
文章平均质量分 83
追逐星辰的光
脚踏实地,虚心前行
展开
-
最大的位或 HDU - 5969
B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数x,y满足l 其中|表示按位或,即C、 C++、 Java中的|运算。Input包含至多10001组测试数据。 第一行有一个正整数,表示数据的组数。 接下来每一行表示一组数据,包含两个整数l,r。 保证 0 10181018。Output对于每组数据输出一行,表示最大的位或。Sample I原创 2017-10-11 22:05:44 · 509 阅读 · 0 评论 -
hdu 5873 Football Games
Football GamesA mysterious country will hold a football world championships---Abnormal Cup, attracting football teams and fans from all around the world. This country is so mysterious that none原创 2017-10-23 17:29:25 · 273 阅读 · 0 评论 -
hdu 5874 Friends and Enemies
Friends and Enemies On an isolated island, lived some dwarves. A king (not a dwarf) ruled the island and the seas nearby, there are abundant cobblestones of varying colors on原创 2017-10-23 17:35:33 · 282 阅读 · 0 评论 -
L One-Dimensional Maze
BaoBao is trapped in a one-dimensional maze consisting of \(n\) grids arranged in a row! The grids are numbered from 1 to \(n\) from left to right, and the \(i\)-th grid is marked with a character \(s原创 2017-10-31 22:37:09 · 744 阅读 · 0 评论 -
Duizi and Shunzi HDU - 6188
Nike likes playing cards and makes a problem of it. Now give you n integers, ai(1≤i≤n)ai(1≤i≤n) We define two identical numbers (eg: 2,22,2) a Duizi, and three consecutive positive integer原创 2017-10-24 20:21:18 · 292 阅读 · 0 评论 -
POJ 1456 Supermarket
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the s原创 2018-01-23 14:07:13 · 245 阅读 · 0 评论 -
POJ - 3617 Best Cow Line
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.The contest orga原创 2018-01-07 16:40:56 · 316 阅读 · 0 评论 -
POJ - 3069 Saruman's Army
Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each pala原创 2018-01-07 17:11:17 · 562 阅读 · 0 评论 -
POJ - 3253 Fence Repair
Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li原创 2018-01-07 20:36:23 · 303 阅读 · 0 评论