码迷,mamicode.com
首页 > 其他好文 > 详细

☆1053

时间:2019-02-09 21:13:12      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:支持   style   it!   pre   int   div   end   abc   nod   

  • cmp的编写   return a>b(从大到小)  a<b(从小到大)   
    bool cmp(int a, int b){
    return(Node[a].weight>Node[b].weight);
    }


    sort(Node[parent].child.begin(),Node[parent].child.end(),cmp);//给孩子们排序,从第一个到最后一个孩子

    struct node{
        int x, y;
    }ssd[10];
    
    bool cmp(node a, node b){
      return a.x>b.x;  
    }
    
    node ssd[10];
    sort(ssd, ssd + 10, cmp);  

     

  • set的迭代器不支持小于号,只能用
    for(set<int>::iterator it!=abc.begin();it!=abc.end();it++){}

     

☆1053

标签:支持   style   it!   pre   int   div   end   abc   nod   

原文地址:https://www.cnblogs.com/flipped415/p/10357927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!