提交记录 3613


用户 题目 状态 得分 用时 内存 语言 代码长度
xy20130630 1000i. 【传统题】 A+B Problem Accepted 100 17.24 us 32 KB C++ 1.74 KB
提交时间 评测时间
2018-07-16 21:26:09 2020-07-31 21:20:47
/*+lmake
 * DEFINE += WAAUTOMATON
 */
#include <stdio.h>
#ifdef WAAUTOMATON
#define debug(args...) \
    {                  \
	dbg, args;     \
	cerr << endl;  \
    }
#define massert(x) assert(x)
#else
#define debug(args...) // Just strip off all debug tokens
#define massert(x)
#endif
typedef long long LL;
typedef unsigned long long ULL;
template <size_t _I_Buffer_Size = 1 << 23, size_t _O_Buffer_Size = 1 << 23>
struct IO_Tp {
    char _I_Buffer[_I_Buffer_Size];
    char* _I_pos;

    char _O_Buffer[_O_Buffer_Size];
    char* _O_pos;

    IO_Tp()
	: _I_pos(_I_Buffer)
	, _O_pos(_O_Buffer)
    {
	fread(_I_Buffer, 1, _I_Buffer_Size, stdin);
    }

    ~IO_Tp() { fwrite(_O_Buffer, 1, _O_pos - _O_Buffer, stdout); }

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

    template <typename Int>
    inline IO_Tp& operator>>(Int& res)
    {
	res = 0;
	int k = 1;
	while (!is_digit(*_I_pos)) {
	    if (*_I_pos == '-')
		k = -1;
	    _I_pos++;
	}
	do
	    (res *= 10) += (*_I_pos++) & 15;
	while (is_digit(*_I_pos));
	res *= k;
	return *this;
    }

    inline IO_Tp& operator>>(char& res)
    {
	res = *_I_pos++;
	return *this;
    }

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

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

    inline IO_Tp& operator<<(char ch)
    {
	*_O_pos++ = ch;
	return *this;
    }
};
IO_Tp<> IO;

int main()
{
    int n;
    IO >> n;
    while (n--) {
	int a, b;
	IO >> a >> b;
	IO << a + b << '\n';
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #117.24 us32 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-11-23 23:29:25 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠