原创 hdu1272(並查集)

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1272 思路: 1、判斷所有點是否聯通,用邊數=頂點數-1 來判斷 2、判斷有沒成環,用並查集來判斷兩個點是否聯通,如果已經聯通,

原创 Codeforces616C The Labyrinth

C. The Labyrinth time limit per test 1 second memory limit per test 256 megabytes input standard input output

原创 poj2533&&hdu1087 最長上升子序列問題

題目鏈接: http://poj.org/problem?id=2533 http://acm.hdu.edu.cn/showproblem.php?pid=1087 最長上升子序列問題: 思路1:dp[i]表示以i結尾的最

原创 hdu2571 簡單dp

命運 Problem Description 穿過幽谷意味着離大魔王lemon已經無限接近了! 可誰能想到,yifenfei在斬殺了一些蝦兵蟹將後,卻再次面臨命運大迷宮的考驗,這是魔王lemon設下的又一個機關。要知道,不論何人

原创 hdu3410 單調隊列

** Passing the Message ** Problem Description What a sunny day! Let’s go picnic and have barbecue! Today, all kids

原创 hdu2955 dp(揹包)

** Robberies ** Problem Description The aspiring Roy the Robber has seen a lot of American movies, and knows that t

原创 cs231n assignment1--Softmax

svm實現完了,這部分會相對比較輕鬆,大部分和svm類似。 關於梯度的推導,我主要參考這篇文章 http://www.jianshu.com/p/004c99623104multiclass 梯度推導: 向量化的實現和

原创 hdu3998 最長上升子序列及其個數 dp或dp+最大流

Sequence Problem Description There is a sequence X (i.e. x[1], x[2], …, x[n]). We define increasing subsequence of

原创 hdu 3790 最短路

最短路徑問題 Problem Description 給你n個點,m條無向邊,每條邊都有長度d和花費p,給你起點s終點t,要求輸出起點到終點的最短距離及其花費,如果最短距離有多條路線,則輸出花費最少的。 Input 輸入n,m,點

原创 hdu1548 最短路

** A strange lift ** Problem Description There is a strange lift.The lift can stop can at every floor as you want,

原创 hdu1421

搬寢室 Problem Description 搬寢室是很累的,xhd深有體會.時間追述2006年7月9號,那天xhd迫於無奈要從27號樓搬到3號樓,因爲10號要封樓了.看着寢室裏的n件物品,xhd開始發呆,因爲n是一個小於200

原创 hdu1160 dp+路徑記錄

FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s

原创 hdu1171 二進制優化揹包問題

Big Event in HDU Problem Description Nowadays, we all know that Computer College is the biggest department in HDU.

原创 hdu1069 最長上升子序列變形

Monkey and Banana Problem Description A group of researchers are designing an experiment to test the IQ of a monkey

原创 hdu2577

** How to Type ** Problem Description Pirates have finished developing the typing software. He called Cathy to test