原创 hdu Problem-5702(結構體排序)
Solving Order Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s)
原创 UVa 540(map+queue)
Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however,
原创 priority_queue的用法
class template <queue> std::priority_queue template <class T, class Container = vector<T>, class Compare = less<
原创 hdu Problem-1004(map+sort)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submis
原创 hdu Problem-4004(二分)
The Frog's Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission
原创 sort的用法
std::sort default (1) template <class RandomAccessIterator> void sort (RandomAccessIterator first, RandomAccessI
原创 最大化平均值(二分搜索)
//有n個物品的重量和價值分別是Wi和Vi.從中選出k個物品使得單位重量的價值最大 bool judge(double mid) { vector<double> vec; for(int i=0;i<N;++i) vec.pus
原创 hdu Problem-4277(dfs+set)
USACO ORZ Time Limit: 5000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 49
原创 UVa136 Ugly Numbers(優先隊列+set判重)
//思路:如果x是醜數,那麼2*x,3*x,5*x都是醜數,則可以用一個優先隊列保存生成的醜數(另外需要判重即相同的醜數不能入隊列) AC源碼: #include <iostream> #include <set> #include <
原创 UVa 1592Database(map的妙用)
Peter studies the theory of relational databases. Table in the relational database consists of values that are arrange
原创 Connected Cells in a Grid(dfs)
Consider a matrix with rows and columns, where each cell contains either a or a and any cell containing a
原创 UVa156(map的使用)
//思路:用map<string,int>記錄重排string後出現的次數,如果爲1次,就是我們想要的結果 AC源碼: #include <iostream> #include <string> #include <vector> #i
原创 UVa10474(排序和查找)
//思路:用vector<int>存儲,在sort排序就可以了 AC代碼: #include <iostream> #include <vector> #include <algorithm> using namespace std;
原创 hdu Problem-1678(priority_queue+模擬)
Shopaholic Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3
原创 hdu Problem-1896(優先隊列+模擬)
Stones Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 2739