輸入輸出優化

cin關同步

cin.sync_with_stdio(false);

cin.tie(0);

讀入掛

inline ll read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;

}

輸出掛

inline void Out(LL a)///輸出外掛
{
    if(a>9)
        Out(a/10);
    putchar(a%10+'0');

}

文件輸入輸出

freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章