Problem F:汽車加油 Time Limit:1000MS Memory Limit:65536K Total Submit:1400 Accepted:404 Language: not limited Description 一輛汽車加滿油后可行駛n公里。旅途中有若干個加油站。設計一個有效算法,指出應在哪些加油站停靠加油,使沿途加油次數最少。 編程任務: 對于給定的n和k(k <= 10000)個加油站位置,編程計算最少加油次數。 Input 第一行有2 個正整數n和k,表示汽車加滿油后可行駛n公里,且旅途中有k個加油站。接下來的1 行中,有k+1 個整數,表示第k個加油站與第 k-1 個加油站之間的距離。第0 個加油站表示出發地,汽車已加滿油。第k+1 個加油站表示目的地。 Output 輸出最少加油次數。如果無法到達目的地,則輸出”No Solution”。 Sample Input 7 7 1 2 3 4 5 1 6 6 Sample Output 4
標簽: Limit Accepted Language Problem
上傳時間: 2016-04-12
上傳用戶:youth25
這是MODBUS軟體的範例程式 希望對各位有幫助 趕快去下載吧!
上傳時間: 2013-11-29
上傳用戶:kr770906
轉載的程序應用框架,本框架具有高度的模塊耦合。
標簽: 程序
上傳時間: 2016-04-23
上傳用戶:啊颯颯大師的
Hybrid Monte Carlo sampling.SAMPLES = HMC(F, X, OPTIONS, GRADF) uses a hybrid Monte Carlo algorithm to sample from the distribution P ~ EXP(-F), where F is the first argument to HMC. The Markov chain starts at the point X, and the function GRADF is the gradient of the `energy function F.
標簽: Carlo Monte algorithm sampling
上傳時間: 2013-12-02
上傳用戶:jkhjkh1982
牛頓法的程序實現: 給的函數是f(x)=X*X-C 求導函數為ff() 也是在程序中已給定 若要修改則在程序中更改
上傳時間: 2014-02-09
上傳用戶:xinzhch
具有無線網路功能下載至嵌入式開發平臺上用的.o黨 driver
上傳時間: 2014-01-23
上傳用戶:dongqiangqiang
#用法: perl -f bookmarks.pl "firefox 書簽的完整路徑“ 用于將firefox瀏覽器的書簽轉化為IE瀏覽器書簽的代碼
上傳時間: 2013-12-19
上傳用戶:xieguodong1234
實現最優二叉樹的構造;在此基礎上完成哈夫曼編碼器與譯碼器。 假設報文中只會出現如下表所示的字符: 字符 A B C D E F G H I J K L M N 頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57 字符 O P Q R S T U V W X Y Z , . 頻度 63 15 1 48 51 80 23 8 18 1 16 1 6 2 要求完成的系統應具備如下的功能: 1.初始化。從終端(文件)讀入字符集的數據信息,。建立哈夫曼樹。 2.編碼:利用已建好的哈夫曼樹對明文文件進行編碼,并存入目標文件(哈夫曼碼文件)。 3.譯碼:利用已建好的哈夫曼樹對目標文件(哈夫曼碼文件)進行編碼,并存入指定的明文文件。 4.輸出哈夫曼編碼文件:輸出每一個字符的哈夫曼編碼。
上傳時間: 2014-11-23
上傳用戶:shanml
用匯編語言來使鍵盤成為一個演奏音樂的電子琴。高音依次1,2,3,4,5,6,7 。中音依次為q,w,e,r,t,y,u 。低音依次為a,s,d,f,g,h,j
上傳時間: 2013-12-17
上傳用戶:wangdean1101
This demonstration models a flight control for the longitudinal motion of a Grumman Aerospace F-14 Tomcat. First order linear approximations of the aircraft and actuator behavior are connected to an analog flight control design that uses the pilot s stick pitch command as the set point for the aircraft s pitch attitude and uses aircraft pitch angle and pitch rate to determine commands. A simplified Dryden wind gust model is incorporated to perturb the system.
標簽: demonstration longitudinal Aerospace Grumman
上傳時間: 2016-05-17
上傳用戶:wang5829