zoukankan      html  css  js  c++  java
  • STL: 排列(permutation)

    next_permutation

    Reorders the elements in a range so that the original ordering is replaced by the lexicographically next greater permutation if it exists, where the sense of next may be specified with a binary predicate.

    template<class BidirectionalIterator> 
       bool next_permutation( 
          BidirectionalIterator _First,  
          BidirectionalIterator _Last 
       ); 
    template<class BidirectionalIterator, class BinaryPredicate> 
       bool next_permutation( 
          BidirectionalIterator _First,  
          BidirectionalIterator _Last, 
          BinaryPredicate _Comp 
       );

    prev_permutation

    Reorders the elements in a range so that the original ordering is replaced by the lexicographically previous greater permutation if it exists, where the sense of previous may be specified with a binary predicate.

    template<class BidirectionalIterator>
       bool prev_permutation(
          BidirectionalIterator _First, 
          BidirectionalIterator _Last
       );
    template<class BidirectionalIterator, class BinaryPredicate>
       bool prev_permutation(
          BidirectionalIterator _First, 
          BidirectionalIterator _Last,
          BinaryPredicate _Comp
       );
  • 相关阅读:
    codechef FNCS
    bzoj2653 middle
    CF698F Coprime Permutation
    CF538H Summer Dichotomy
    CF930E Coins Exhibition
    CF468D Tree
    CF528E Triangles3000
    BZOJ 4066: 简单题
    BZOJ 4300: 绝世好题
    BZOJ 4520: [Cqoi2016]K远点对
  • 原文地址:https://www.cnblogs.com/freewater/p/2954160.html
Copyright © 2011-2022 走看看