快读快写
int read() {
register int x = 0,f = 1;register char ch;
ch = getchar();
while(ch > '9' || ch < '0'){if(ch == '-') f = -f;ch = getchar();}
while(ch <= '9' && ch >= '0'){x = x * 10 + ch - 48;ch = getchar();}
return x * f;
}
void write(int x){
if(x<0){putchar('-');x=-x;}//若x为负数,输出符号并取其绝对值
if(x>9){write(x/10);putchar(x%10+'0');}//输出绝对值(采用递归的做法,减少代码量)
else putchar(x+'0');
return;
}
n >= 1e8时,比scanf和printf快一倍左右