标签:str turn space tor 优先 ret bool include clu
#include <iostream> #include <queue> #include <vector> #include <stdio.h> using namespace std; struct p{ int x,y,t; bool operator < (const p &a)const { return t>a.t;//取时间最少优先 } }Point; int main(){ priority_queue<p> q; for( int i = 1; i <= 5; i++ ){ Point.x = i; Point.y = i; Point.t = i; q.push(Point); } while( !q.empty() ){ cout << q.top().t << endl; q.pop(); } } #include <iostream> #include <queue> using namespace std; struct cmp{ bool operator < (int &a,int &b){ return a < b; } } int main(){ queue<int,vector<int>,cmp> q; }
标签:str turn space tor 优先 ret bool include clu
原文地址:http://www.cnblogs.com/yakoazz/p/6501090.html