快读快写在数据量大时优势很明显即使是
printf(?);
和
关同步流
ios::synt_with_stdio(0);
也比不上
inline int readint(){//开不开inline都差不多
char c=getchar();
bool flag=false;
int sum=0;
while(c<'0'||c>'9'){
if(c=='-') flag=true;
c=getchar();
}
while(c>='0'&&c<='9') sum=(sum<<1)+(sum<<3)+c-'0',c=getchar();
return (flag)?-(sum):(sum);
}
inline void writeint(int x){
if(x<0){x=-x;putchar('-');}
if(x>9) writeint(x/10);
putchar(x%10+'0');
}
inline string readstr(){
string s;
int tot=0;char ch=getchar();
while(ch==' '||ch=='\n') ch=getchar();
while(ch!=' '&&ch!='\n'){
s+=ch;
ch=getchar();
}
return s;
}
inline void writestr(string s){
int len=s.size();
for(int i=0;i<len;i++) putchar(s[i]);
}
虽然差不多,没必要