读入优化

关同步:

std::ios::sync_with_stdio(0);

肖恩式关同步:ios::sync_with_stdio(false); //关同步 

std::cin.tie(0);

std::cout.tie(0);

快读:
inline int read(){
    int x = 0,f = 1;
    char ch = getchar();
    while( !isdigit(ch) ){
        if( ch == '-' )
            f = -1;
        ch = getchar();
    }
    while( isdigit(ch) ){
        x = ( x<<3 ) + ( x<<1 ) + ( ch^48 );
        ch = getchar();
    }
    return x*f;
}

 

posted @ 2022-07-11 14:41  little_sheep_xiaoen  阅读(23)  评论(0编辑  收藏  举报