cars refueling problem:with greedy algorithm
go to
http://blog.csdn.net/newner/article/details/8637065
好奇怪的表達方式,這道題的英文給跪了 第三行的序列居然是給出依次要進行比較的老鼠的標號。 11 3 25 18 0 46 37 3 19 22 57 56 10 6 0 8 7 10 5 9 1 4 2 3 先比較第6,0,8號老鼠,此
//sort// 1025. PAT Ranking.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> #include <cstring> #include <algorithm> u
題目的意思是求一個數n=k個數的p次方之和。 對n進行深度優先搜索,按照遞減的順序進行搜索,並計算sum的值,如果sum的值比maxxx大,則更新vector,並用ans來統計結果次數,如果爲0,那麼輸出impossible。 還用了快速