提交记录 7694


用户 题目 状态 得分 用时 内存 语言 代码长度
dvb 1000i. 【传统题】 A+B Problem Wrong Answer 0 38.88 us 16 KB C++ 1.40 KB
提交时间 评测时间
2019-01-25 09:26:15 2020-08-01 01:07:22
#include<cstdio>
#define R register int
int T,a,b;
namespace FastIO {
    const int SIZE = 1 << 16;
    char buf[SIZE], str[64];
    int l = SIZE, r = SIZE;
    int read(char *s) {
        while (r) {
            for (; l < r && buf[l] <= ' '; l++);
            if (l < r) break;
            l = 0, r = int(fread(buf, 1, SIZE, stdin));
        }
        int cur = 0;
        while (r) {
            for (; l < r && buf[l] > ' '; l++) s[cur++] = buf[l];
            if (l < r) break;
            l = 0, r = int(fread(buf, 1, SIZE, stdin));
        }
        s[cur] = '\0';
        return cur;
    }
    template<typename type>
    bool read(type &x, R len = 0, R cur = 0, bool flag = false) {
        if (!(len = read(str))) return false;
        if (str[cur] == '-') flag = true, cur++;
        for (x = 0; cur < len; cur++) x = x * 10 + str[cur] - '0';
        if (flag) x = -x;
        return true;
    }
    template <typename type>
    type read(R len = 0, R cur = 0, bool flag = false, type x = 0) {
        if (!(len = read(str))) return false;
        if (str[cur] == '-') flag = true, cur++;
        for (x = 0; cur < len; cur++) x = x * 10 + str[cur] - '0';
        return flag ? -x : x;
    }
} using FastIO::read;

int plus(R a,R b) {
	if(!a || !b) return a|b;
	return ((a&b) << 1,a ^ b);
}
int main() {
	read(T);
    for(R i = 1;i <= T;++i) {
        read(a),read(b);
        printf("%d\n",plus(a,b));
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #138.88 us16 KBWrong AnswerScore: 0


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