☆1053

Posted flipped415

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了☆1053相关的知识,希望对你有一定的参考价值。

  • 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的主要内容,如果未能解决你的问题,请参考以下文章