114 条题解

  • -6
    @ 2021-11-9 16:40:50

    虽然这种简单题写个快读确实是大材小用, 但是有了快读,这个程序的主程序就可如python一般简洁

    因此就有了这篇题解,大家就当学快读的写法吧qwq

    #include <bits/stdc++.h>
    using namespace std;
    inline int read()
    {
        int X = 0; bool f = false; char ch = getchar();
        while (ch > '9' || ch < '0') {f |= ch == '-'; ch = getchar();}
        while (ch <= '9' && ch >= '0') {X = (X << 3) + (X << 1) + (ch ^ 48); ch = getchar();}
        return f ? -X : X;
    }
    inline void write(int X)
    {
        if (X == 0) {putchar('0'); return;}
        if (X < 0) {putchar('-'); X = -X;}
        short num[21], cnt = 0;
        while (X) {num[++cnt] = X % 10; X /= 10;}
        while (cnt) putchar(num[cnt--] ^ 48);
        return;
    }
    int main()
    {
        write(read() + read());
        return 0;
    }
    

    信息

    ID
    56
    时间
    1000ms
    内存
    1024MiB
    难度
    1
    标签
    递交数
    7033
    已通过
    3080
    上传者