ll read(){
ll x=0,f=1;char ch=getchar();
while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
cin/cout加速:关掉cin与scanf的同步,使cin不用存到缓存区,不用和cout对应
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
转载:http://blog.youkuaiyun.com/f_zyj/article/details/51473493
这个姑娘太棒了,佩服。