1. 程式人生 > 其它 >NOIP需要掌握的一些stl庫

NOIP需要掌握的一些stl庫

/*
map
set
//bitset
vector
priority_queue

*/
#include <bits/stdc++.h>
using namespace std;



priority_queue <int,vector<int>,less<int> > a1;    //大根堆         priority_queue <int> a1
priority_queue <int,vector<int>,greater<int> > a2;    //小根堆 

struct node{
    
int x,y; }; bool operator<(node a,node b){ return a.x<b.x; } priority_queue <node> a3; map <string,node> f; //log(n) vector<int> w; vector<int> e[100005]; int main(){ string s="ssd"; f[s]=(node){3,4}; w.push_back(3); //w[0]=3; // w.resize(5);
// w.size(); int n,m; scanf("%d%d",&n,&m); for (int i=1;i<=m;++i){ int x,y; scanf("%d%d",&x,&y); e[x].push_back(y); } { int x=5,y; for (int i=0;i<e[x].size();++i){ //e[x].size:unsigned y=e[x][i]; //
x -> y } } return 0; }
轉載請標明出處 http://www.cnblogs.com/cyz666/