提交记录 7099


用户 题目 状态 得分 用时 内存 语言 代码长度
EndSaH 1000i. 【传统题】 A+B Problem Runtime Error 0 5.87 us 8 KB C++ 1.17 KB
提交时间 评测时间
2018-12-17 22:27:28 2020-08-01 00:59:08
/**********************************************************
 * Author        : EndSaH
 * Email         : hjxhb1@gmail.com
 * Created Time  : 2018-12-17 21:07
 * FileName      : wib.cpp
 * Website       : https://endsah.cf
 * *******************************************************/

#pragma GCC optimize("Ofast,unroll-loops")
#include <sys/mman.h>
#include <unistd.h>
#include <cstdio>
#include <cctype>

char _obuf[2000], _stk[11];

#define read(x)\
(x) = 0, _flag = 1;\
while(!isdigit(*ipos))\
{\
    if(*ipos == '-')\
        _flag = -1;\
    ++ipos;\
}\
while((x) = ((x) << 3) + ((x) << 1) + (*ipos++ & 15), isdigit(*ipos));\
(x) *= _flag;

int main()
{
    register char *ipos = (char*)mmap(NULL, lseek(0, 0, SEEK_END), PROT_READ, MAP_PRIVATE, 0, 0), *opos = _obuf, *stkpos = _stk;
    register unsigned int n, _flag, a, b;
    read(n);
    while(n--)
    {
        read(a); read(b);
        a += b;
        if(a < 0)
            *opos++ = '-', a *= -1;
        do
        {
            *++stkpos = a % 10 ^ 48;
            a /= 10;
        } while(a);
        while(stkpos != _stk)
            *opos++ = *stkpos--;
        *opos++ = '\n';
    }
    fwrite(_obuf, 1, opos - _obuf, stdout);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #15.87 us8 KBRuntime ErrorScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-09 00:38:56 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠