1. 程式人生 > >每日三題-Day2-C(HDU 1087 Super Jumping! Jumping! Jumping! 最大上升子序列和)

每日三題-Day2-C(HDU 1087 Super Jumping! Jumping! Jumping! 最大上升子序列和)

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.



The game can be played by two or more than two players. It consists of a chessboard(棋盤)and some chessmen(棋子), and all chessmen are marked by a positive integer or “start” or “end”. The player starts from start-point and must jumps into end-point finally. In the course of jumping, the player will visit the chessmen in the path, but everyone must jumps from one chessman to another absolutely bigger (you can assume start-point is a minimum and end-point is a maximum.). And all players cannot go backwards. One jumping can go from a chessman to next, also can go across many chessmen, and even you can straightly get to end-point from start-point. Of course you get zero point in this situation. A player is a winner if and only if he can get a bigger score according to his jumping solution. Note that your score comes from the sum of value on the chessmen in you jumping path.
Your task is to output the maximum value according to the given chessmen list.

相關推薦

每日-Day2-CHDU 1087 Super Jumping! Jumping! Jumping! 上升序列

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game,

每日-Day1-CHDU 1069 Monkey and Banana 有序序列

A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, pro

每日-Day3-CHDU 1257 最少攔截系統 上升序列O(nlogn)

原題地址 最少攔截系統 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 40250 Accepted Submi

每日-Day5-CHDU 1078 FatMouse and Cheese 記憶化搜尋

FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p

每日-Day2-BHDU 1114 Piggy-Bank 完全揹包

原題地址 Piggy-Bank Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24047 Accepted S

hdu 1087 Super Jumping! Jumping! Jumping!dp 上升序列

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game,

hdoj1087:Super Jumping! Jumping! Jumping!dp基礎-上升序列可不連續

目錄 Super Jumping! Jumping! Jumping! 題目解釋: 解題思路: ac程式碼: Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other) &nb

hdoj087:Super Jumping! Jumping! Jumping!dp基礎-上升序列可不連續

目錄 題目解釋: 解題思路: ac程式碼: Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Ot

每日-Day3-AHDU 1176 免費餡餅 數塔

原題地址 免費餡餅 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 47725 Accepted Submissi

4C語言——求連續序列

log spa clas 最大連續子序列和 alloc 最大 code max 連續 題目: 輸入一組整數,求出這組數字子序列和中最大值。也就是只要求出最大子序列的和,不必求出最大的那個序列。例如: 序列:-2 11 -4 13 -5 -2,則最大子序列和為20。 序列:-

HDU-1087(上升序列)

題意:給你一序列,找出一個和最大的上升子序列, 輸出它的和。 思路:動態規劃,建立dp陣列。因為這題要求是上升子序列,我們需要知道當前子序列末尾的值,所以可使dp[i]表示以i結尾的序列的最大和。這樣迴圈到a[i]時,可通過找到dp陣列前i-1項的最大值dp[j],並比較a[j](當前序列最後一

動態規劃長遞增序列LIS、連續序列連續序列乘積

最長遞增子序列LIS 問題 給定一個長度為N的陣列,找出一個最長的單調自增子序列(不一定連續,但是順序不能亂)。例如:給定一個長度為6的陣列A{5, 6, 7, 1, 2, 8},則其最長的單調遞增子序列為{5,6,7,8},長度為4. 最長遞增子序列

HDU 1024 Max Sum Plus Plusm

Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. No

HDU 5842.Lweb and String【上升序列】【思路】【8月20】

Lweb has a string S. Oneday, he decided to transform this string to a new sequence.  You need help him determine this transformation to get a sequence whi

hdu 1003 Max Sum(連續序列) 學了一下分治

都不知道以前刷杭電是怎麼做的最大連續子序列和,仔細一想,我以前好像是dp寫的, 然後現在再來寫居然發現不能快速寫出來了。。 真是坑啊。。 看了自己以前寫的最大連續子序列和的程式碼, 真的是讓我噁心死了。。  程式碼風格慘不忍睹 前兩天在大白書看到最大連續子序列和可以用分治去

HDU 1231 連續序列連續

Description 求最大連續子段和,並輸出此欄位的起始位置和終止位置的值 Input 多組用例,每組用例第一行為序列長度n,第二行n個整數表示該序列,以n=0結束輸入 Output 對每

HDU 1160 FatMouse's Speed (上升序列)

tar 1-1000 題解 sin pid pac blank scan target 題目鏈接 題意:n個老鼠有各自的重量和速度,要求輸出最長的重量依次嚴格遞增,速度依次嚴格遞減的序列,n最多1000,重量速度1-10000。 題解:按照重量遞增排序,找出最長的速度下降子

Hdu 1257 LIS攔截系統 上升序列或動態規劃

語言表達能力欠佳。。。 思路一:依次遞減序列的最小個數其實就是求最大上升子序列 思路二:正常思路:開始所有的(就是dp陣列)都預設為使用系統1,a[i]>a[j](0<j<i)dp[i]=max(dp[i],dp[j]+1). 例如 4    &nb

Super Jumping! Jumping! Jumping! hdu1087遞增

題目連結 求一個數列的最大遞增子序列和。 注意限制在32位整型範圍內,是可能有負數的。 前i個數字的最大遞增子序列和有兩種情況,加上第i個數字,不加上第i個數字。前者是把i串到之前的某個子段之後一位。 #include<bits/stdc++.h> usi

1007 Maximum Subsequence Sum25 分連續序列

題意:求最大連續子序列和並記錄該序列的頭尾元素 #include <bits/stdc++.h> using namespace std; int N; int main() { cin>>N; vector<int>