摘要: JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines. Half of these cities are rich in r 阅读全文
posted @ 2017-08-03 22:57 天之道,利而不害 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 摘自《挑战程序设计竞赛》如有错误,请指正! (1) 定义:dp[ i ]表示以Ai为末尾的最长上升子序列。 以Ai结尾的上升子序列是:①只包含Ai的子序列②再满足 j < i 并且Aj < Ai 的以Aj为结尾的子序列,追加上Ai后得到的子序列。 于是,dp[ i ]=max(1,dp[ j ]+1 阅读全文
posted @ 2017-08-03 22:41 天之道,利而不害 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she 阅读全文
posted @ 2017-08-03 21:59 天之道,利而不害 阅读(173) 评论(0) 推荐(0) 编辑