快速读入
ll f=1;char c;
for(x=0,c=getchar();c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48); x*=f;
}
功能:高效读取大整数 n(适配 (10^{18}) 范围)。
优化点:用位运算(x<<1 等价 (x2),x<<3 等价 (x8))和字符异或(c^48 等价 c-'0')替代乘法和减法,提升读取速度。

京公网安备 11010502036488号