摘要:
Description Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he re 阅读全文
摘要:
Description It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with 阅读全文
摘要:
Description n children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to n. In the beginning, the 阅读全文
摘要:
Description 想想双向链表……双向队列的定义差不多,也就是说一个队列的队尾同时也是队首;两头都可以做出队,入队的操作。现在给你一系列的操作,请输出最后队列的状态;命令格式:LIN X X表示一个整数,命令代表左边进队操作;RIN X 表示右边进队操作;ROUTLOUT 表示出队操作; In 阅读全文
摘要:
Description Background Binary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the 阅读全文
摘要:
Description In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary 阅读全文
摘要:
Description堆栈是一种基本的数据结构。堆栈具有两种基本操作方式,push 和 pop。push一个值会将其压入栈顶,而 pop 则会将栈顶的值弹出。现在我们就来验证一下堆栈的使用。 Input首先输入整数t(1 <= t <= 10),代表测试的组数,以后是 t 组输入。 对于每组测试数据 阅读全文
摘要:
For n elements x1, x2, ..., xn with positive integer weights w1, w2, ..., wn. The weighted median is the element xk satisfying and , S indicates Can y 阅读全文