读入优化
关同步:
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; }