提交记录 5698


用户 题目 状态 得分 用时 内存 语言 代码长度
codesonic 1000i. 【传统题】 A+B Problem Accepted 100 18.03 us 32 KB C++ 1.57 KB
提交时间 评测时间
2018-09-01 23:24:19 2020-08-01 00:21:36
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <stdio.h>
#include <math.h>
#include <string.h>

struct IO_Tp {
    char _I_Buffer[1 << 12], _O_Buffer[1 << 12], *_I_pos, *_O_pos;

    IO_Tp() : _I_pos(_I_Buffer), _O_pos(_O_Buffer) {
        fread(_I_Buffer, 1, 1 << 12, stdin);
    }
    ~IO_Tp() { fwrite(_O_Buffer, 1, _O_pos - _O_Buffer, stdout); }

    inline bool is_digit(register const char ch) {
        return '0' <= ch && ch <= '9';
    }

    inline IO_Tp& operator>>(int& x) {
        register int res = 0;
        int k = 1;
        while (!is_digit(*_I_pos)) {
            if (*_I_pos == '-')
                k = -1;
            _I_pos++;
        }
        do
            (res = (res << 3) + (res << 1)) += (*_I_pos++) & 15;
        while (is_digit(*_I_pos));
        x = (k == -1 ? -res : res);
        return *this;
    }

    inline char getop() {
        while (!is_digit(*_I_pos))
            _I_pos++;
        return (*_I_pos++) & 15;
    }

    inline IO_Tp& operator<<(register int n) {
        if (n < 0) {
            *_O_pos++ = '-';
            n = -n;
        }
        static char _buf[20];
        char* _pos(_buf);
        do
            *_pos++ = 48 + n % 10;
        while (n /= 10);
        while (_pos != _buf)
            *_O_pos++ = *--_pos;
        return *this;
    }
    inline IO_Tp& operator<<(register char ch) {
        *_O_pos++ = ch;
        return *this;
    }
};

IO_Tp IO;

int main(void) {
    int n, a, b;
    IO >> n;
    for (int i = 0; i < n; ++i) {
        IO >> a >> b;
        IO << a + b << '\n';
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #118.03 us32 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-04-23 15:53:37 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用