__int128 & __uint128_t

128位长整型和128位无符号长整形。

取值范围:

__int128 : $[2^{-127} , 2^{127} - 1]$

__uint128_t :$[0 , 2^{128}-1]$

由于不支持读写,所以要手写读写

typedef __uint128_t int128;
inline int128 read(){
    int128 x = 0,f = 1;
    char ch = getchar();
    while(ch < '0' || ch > '9'){
        if(ch == '-')f = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9')x = (x<<1) + (x<<3) + (ch^48),ch = getchar();
    return x * f;
}
inline void print(int128 x){
    if(x == 0)return;
    print(x/10);
    putchar(x%10+'0');
}

 

posted @ 2022-03-22 14:45  Xu_brezza  阅读(349)  评论(0编辑  收藏  举报