摘要: This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occu 阅读全文
posted @ 2019-07-11 23:07 自由之翼Az 阅读(199) 评论(0) 推荐(0) 编辑
摘要: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elev 阅读全文
posted @ 2019-07-11 22:03 自由之翼Az 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, ..., N​j​​ } where 1. The Max 阅读全文
posted @ 2019-07-11 21:44 自由之翼Az 阅读(206) 评论(0) 推荐(0) 编辑
摘要: At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door 阅读全文
posted @ 2019-07-11 20:29 自由之翼Az 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目描述 输入描述: 输出描述: 输入例子: 输出例子: 阅读全文
posted @ 2019-07-11 20:08 自由之翼Az 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 【题目】 一个栈中元素的类型为整型,现在想将该栈从顶到底按从大到小的顺序排序,只许申请一个栈。除此之外,可以申请新的变量,但不能申请额外的数据结构。如何完成排序? 【题解】 将要排序的栈记为stack,申请的辅助栈记为help。在stack上执行pop操作,弹出的元素记为cur。·如果cur小于或等 阅读全文
posted @ 2019-07-11 15:58 自由之翼Az 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 【题目】一个栈依次压入1、2、3、4、5,那么从栈顶到栈底分别为5、4、3、2、1。将这个栈转置后,从栈顶到栈底为1、2、3、4、5,也就是实现栈中元素的逆序,但是只能用递归函数来实现,不能用其他数据结构。 【题解】使用两个递归函数:一个递归函数是将栈底的元素返回并删除另一个函数是将返回的元素进行存 阅读全文
posted @ 2019-07-11 15:43 自由之翼Az 阅读(220) 评论(0) 推荐(0) 编辑
摘要: A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp 阅读全文
posted @ 2019-07-11 14:36 自由之翼Az 阅读(166) 评论(0) 推荐(0) 编辑