编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#100364 #1001. A. 神秘谜题 Wrong Answer 0 972 ms 30160 K C++ 17 / 1.6 K sunrise1024 2023-07-15 21:48:18
显示原始代码
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 5;
int n;
struct node {
    int s[2];
    int cn;
    int d;
    int ed;
} t[N * 100];
int cn = 1;
int te[30], an;
void ins(int x) {
    int no = 1;
    t[no].cn++;
    do {
        if (x & 1) {
            te[t[no].d]++;
            if (!t[no].s[1]) {
                t[no].s[1] = ++cn;
                t[cn].d = t[no].d + 1;
            }
            no = t[no].s[1];
            t[no].cn++;
        } else {
            if (!t[no].s[0]) {
                t[no].s[0] = ++cn;
                t[cn].d = t[no].d + 1;
            }
            no = t[no].s[0];
            t[no].cn++;
        }
        x >>= 1;
    } while (x);
    t[no].ed++;
}
void add() {
    int no = 1;
    while (t[no].cn) {
        te[t[no].d] -= t[t[no].s[1]].cn;
        te[t[no].d] += t[t[no].s[0]].cn;
        swap(t[no].s[0], t[no].s[1]);
        no = t[no].s[0];
        if (!t[no].s[1]) {
            t[no].s[1] = ++cn;
            t[cn].d = t[no].d + 1;
        }
        t[t[no].s[1]].cn += t[no].ed;
    }
}
int main() {
    cin >> n;
    while (n--) {
        int op;
        cin >> op;
        if (op == 1) {
            add();
            an = 0;
            for (int i = 0; i < 30; ++i) {
                if (te[i] & 1) {
                    an += (1 << i);
                }
            }
            cout << an << '\n';
        } else {
            int x;
            cin >> x;
            ins(x);
            an = 0;
            for (int i = 0; i < 30; ++i) {
                if (te[i] & 1) {
                    an += (1 << i);
                }
            }
            cout << an << '\n';
        }
    }
    return 0;
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:497 ms
内存:30160 KiB

输入文件(1.in

200000
2 526767110
2 724642759
2 567837900
2 104106873
2 357915481
2 33997211
2 444788944
2 
<1586974 bytes omitted>

答案文件(1.ans

526767110
877985729
361528077
330887284
116239149
82537142
510237286
843295274
453728745
55
<2188330 bytes omitted>

用户输出

526767110
877985729
361528077
330887284
116239149
82537142
510237286
843295274
453728745
559263713
323554710
713540578
520942594
<1988308 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:475 ms
内存:30076 KiB

输入文件(2.in

200000
2 515979308
2 512702340
2 684230440
2 488136957
2 598252313
2 283603971
2 349877373
2
<1586842 bytes omitted>

答案文件(2.ans

515979308
5115816
679905408
899606653
372667236
114362215
302756634
473674072
520218589
525
<2192841 bytes omitted>

用户输出

515979308
5115816
679905408
899606653
372667236
114362215
302756634
473674072
520218589
525056845
703148326
764590712
207056035

<1992817 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0