ZTL — Zimindaada Template Library 模板库

· · 个人记录

新ZTL

Update in 2020/09/11

0. 初始模板

#include <bits/stdc++.h>
namespace ztd{
    #pragma GCC target ("popcnt")
    using namespace std;
    #define reg register
    #define ms(a) memset(a,0,sizeof(a))
    #define dig_count(x) __builtin_popcountll(x)
    #define smallest_one(x) __builtin_ffsll(x)
    #define endl '\n'
    typedef long long ll;
    typedef unsigned long long ull;
    typedef unsigned int uint;
    typedef double db;
    //basic I/O
    template<typename T> inline T read(T& t) {//fast read
        t=0;short f=1;char ch=getchar();double d = 0.1;
        while (ch<'0'||ch>'9') {if (ch=='-') f=-f;ch=getchar();}
        while (ch>='0'&&ch<='9') t=t*10+ch-'0',ch=getchar();
        if(ch=='.'){ch=getchar();while(ch<='9'&&ch>='0') t+=d*(ch^48),d*=0.1,ch=getchar();}
        t*=f;
        return t;
    }
}
using namespace ztd;

signed main(){

    return 0;
}

更多基础模板

1. 读写优化

- int/long long (已集成于基础模板)

- __int128

2. 数据结构

- Trie

- 树状数组

3. 数学

3.1 组合

- 组合数\Lucas

3.2 数论

- 数论基础模板

3.3 其他

- 矩阵