diff --git a/template.cc b/template.cc index dd9e423..92b5fcd 100644 --- a/template.cc +++ b/template.cc @@ -172,6 +172,17 @@ template pair istream& operator>>(istream&, pair&); +template ostream& operator<<(ostream&, const pair&); +template istream& operator>>(istream&, array&); +template ostream& operator<<(ostream&, const array&); +template +decltype(auto) operator<<(std::basic_ostream&, const std::tuple&); +template ostream& operator<<(ostream&, const vector&); +std::ostream& operator<<(std::ostream&, const int128&); + template istream& operator>>(istream& in, pair& p) { return in >> p.first >> p.second; } @@ -269,6 +280,8 @@ return_t qpow(ll b, ll p) { } // Accurately find `i` 'th root of `n` (taking the floor) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses" inline ll root(ll n, ll i) { ll l = 0, r = pow(LLONG_MAX, ld(1) / i); while (l < r) { @@ -281,6 +294,7 @@ inline ll root(ll n, ll i) { } return l; } +#pragma GCC diagnostic pop #define comb(n, k) ((n) < 0 or (k) < 0 or (n) < (k) ? 0 : fact[n] / fact[k] / fact[(n) - (k)])