algo — C++23 日本語リファレンス GitHub

検証済み · 最終更新 2026-10-22 · GitHub

template/template.hpp

lib/template/template.hpp

インクルード

#include "template/template.hpp"

検証

このヘッダを使うライブラリ(7)
検証プログラム(12)
実装
#pragma once
#pragma GCC optimize("Ofast,fast-math,unroll-all-loops")
#include <bits/stdc++.h>
#if !defined(ATCODER) && !defined(EVAL)
_Pragma("GCC target(\"avx2,popcnt,lzcnt,bmi\")")
#endif
    template <class T, class U>
    constexpr bool chmax(T &a, const U &b) {
    return a < (T)b ? a = (T)b, true : false;
}
template <class T, class U>
constexpr bool chmin(T &a, const U &b) {
    return (T)b < a ? a = (T)b, true : false;
}
constexpr std::int64_t INF = 1000000000000000003;
constexpr int Inf = 1000000003;
constexpr double EPS = 1e-7;
constexpr double PI = 3.14159265358979323846;

bundled

#line 2 "lib/template/template.hpp"
#pragma GCC optimize("Ofast,fast-math,unroll-all-loops")
#include <bits/stdc++.h>
#if !defined(ATCODER) && !defined(EVAL)
_Pragma("GCC target(\"avx2,popcnt,lzcnt,bmi\")")
#endif
    template <class T, class U>
    constexpr bool chmax(T &a, const U &b) {
    return a < (T)b ? a = (T)b, true : false;
}
template <class T, class U>
constexpr bool chmin(T &a, const U &b) {
    return (T)b < a ? a = (T)b, true : false;
}
constexpr std::int64_t INF = 1000000000000000003;
constexpr int Inf = 1000000003;
constexpr double EPS = 1e-7;
constexpr double PI = 3.14159265358979323846;