编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#21279 #1001. A. 神秘谜题 Wrong Answer 0 306 ms 15904 K C++ / 1.0 K 软件82-王成昊 2020-02-04 0:13:09
显示原始代码
#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
struct node {
    int num, son[2];
} T[40 * N];
int cnt, x[45];
long long mi[45];
void init() {
    mi[0] = 1;
    for (int i = 1; i <= 40; ++i) mi[i] = 2 * mi[i - 1];
}
void insert(int xx) {
    int cur = 0, now = 0;
    while (xx) {
        int t = xx % 2;
        xx >>= 1;
        int pos = T[cur].son[t];
        if (!pos)
            pos = T[cur].son[t] = ++cnt;
        cur = pos;
        ++T[cur].num;
        if (t)
            ++x[now];
        ++now;
    }
}
void modify(int now, int dep) {
    if (!T[now].son[0] && !T[now].son[1]) {
        T[now].son[1] = ++cnt;
        T[cnt].num = 1;
        ++x[dep];
        return;
    }
    if (T[now].son[1])
        modify(T[now].son[1], dep + 1);
    x[dep] += T[T[now].son[0]].num - T[T[now].son[1]].num;
    swap(T[now].son[0], T[now].son[1]);
}
int main() {
    init();
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        int t;
        scanf("%d", &t);
        if (t == 2) {
            int x;
            scanf("%d", &x);
            insert(x);
        } else
            modify(0, 0);
        long long ans = 0;
        for (int j = 0; j <= 40; ++j)
            if (x[j] % 2)
                ans += mi[j];
        printf("%lld\n", ans);
    }
    return 0;
}
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:154 ms
内存:15904 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
<1988382 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:152 ms
内存:15860 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

<1992828 bytes omitted>

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0