编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#20544 #1001. A. 神秘谜题 Time Limit Exceeded 0 2049 ms 12112 K C++ / 1.4 K simple 2019-07-24 10:10:32
显示原始代码
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int main() {
    unsigned int x;     //表示神秘数
    unsigned int quan;  //表示加权
    int a[200000][30];  //数据集合
    int aa[30];         //二进制异或和
    unsigned int aaa;   //十进制异或和
    int num_count = 0;  //集合大小
    int op_count;       //操作次数
    int i, j, k;
    int op;  //操作种类
    cin >> op_count;
    for (i = 0; i < op_count; i++) {
        aaa = 0;  //清空
        quan = 1;
        cin >> op;
        if (op == 1) {
            for (j = 0; j < num_count; j++) {
                k = 0;
                while (a[j][k] != 0) {
                    a[j][k] = 0;
                    aa[k] = 1 - aa[k];
                    k++;
                }
                a[j][k] = 1;
                aa[k] = 1 - aa[k];
            }
        }
        if (op == 2) {
            cin >> x;
            k = 0;
            while (x != 0) {
                if (x % 2 == 1) {
                    a[num_count][k] = 1;
                    aa[k] = 1 - aa[k];
                } else
                    a[num_count][k] = 0;
                x = x / 2;
                k++;
            }
            num_count++;
        }
        for (j = 0; j < 30; j++) aaa += quan * aa[j];
        cout << aaa << endl;
    }
    return 0;
}
子任务 #1
Time Limit Exceeded
得分:0
测试点 #1
Time Limit Exceeded
得分:0
用时:1043 ms
内存:11996 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>

用户输出

15
17
15
15
17
16
16
13
16
16
13
15
13
19
18
15
20
13
16
16
15
17
19
18
15
20
17
14
16
13
20
13
17
11
13
15
15
14
14
14
13
17
13
<299402 bytes omitted>
测试点 #2
Time Limit Exceeded
得分:0
用时:1006 ms
内存:12112 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>

用户输出

13
11
8
19
15
14
13
15
18
19
14
16
15
20
12
12
19
16
17
16
13
14
23
19
17
12
16
14
18
15
10
15
20
19
18
12
19
21
19
17
14
13
16

<299238 bytes omitted>