模板

· · 休闲·娱乐

#include <bits/stdc++.h>

namespace yxc {
    #ifdef __linux__
        #define gc getchar_unlocked
        #define put putchar_unlocked
    #else
        #define gc _getchar_nolock
        #define put _putchar_nolock
    #endif
    template <typename T>
    inline T read() {
        T x = 0;
        bool f = 0;
        char ch = gc();
        while (ch > '9' || ch < '0') {
            if (ch == '-') f = 1;
            ch = gc();
        }
        do {
            x = (x << 3) + (x << 1) + (ch ^ 48);
            ch = gc();
        } while (ch >= '0' && ch <= '9');
        return f ? -x : x;
    }
    template <typename T>
    inline void write(T x) {
        if (x < 0) x = -x, put('-');
        static T sta[35];
        T top = 0;
        do {
            sta[top++] = x % 10, x /= 10;
        } while (x);
        while (top) put(sta[--top] + '0');
    }
}
using namespace yxc;
using namespace std;

using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define frep(i, b, a) for (int i = b; i >= a; i--)
#define s second
#define f first
const int inf = (1 << 30) - 1;
const ll INF = 1LL << 60LL;
const int mod = 998244353;