comp-library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub luzhiled1333/comp-library

:heavy_check_mark: chmin
(src/cpp-template/header/change-min.hpp)

chmin

bool chmin(T1 &a, T2 b)

a よりも b のほうが小さいとき a の値を b に変更する。 更新があったときのみ true を返す。

Required by

Verified with

Code

#pragma once

namespace luz {

  template < typename T1, typename T2 >
  inline bool chmin(T1 &a, T2 b) {
    return a > b and (a = b, true);
  }

} // namespace luz
#line 2 "src/cpp-template/header/change-min.hpp"

namespace luz {

  template < typename T1, typename T2 >
  inline bool chmin(T1 &a, T2 b) {
    return a > b and (a = b, true);
  }

} // namespace luz
Back to top page