编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#179 #1001. A. 神秘谜题 Time Limit Exceeded 0 2087 ms 1000 K C++ / 932 B AshGray 2019-06-15 21:43:22
显示原始代码
#include <bits/stdc++.h>
#define int long long

signed main() {
    int N;
    scanf("%lld", &N);
    int* a = (int*)malloc((N + 1) * sizeof(int));
    // printf("%lld", a[10]); //test1
    int flag = 0, count = 0;
    for (int i = 1; i < N; ++i) {
        scanf("%lld", &flag);
        if (flag == 1 && count > 0) {
            for (int j = 1; j <= count; ++j) {
                ++a[j];
            }
        } else if (flag == 2) {
            ++count;
            int temp;
            scanf("%lld", &temp);
            a[count] = temp;
        }
        int temp = a[1];
        for (int k = 1; k < count; ++k) {
            temp ^= a[k + 1];
        }
        printf("%lld\n", temp);
    }
    scanf("%lld", &flag);
    if (flag == 1 && count > 0) {
        for (int j = 1; j <= count; ++j) {
            ++a[j];
        }
    } else if (flag == 2) {
        ++count;
        int temp;
        scanf("%lld", &temp);
        a[count] = temp;
    }
    int temp = a[1];
    for (int k = 1; k < count; ++k) {
        temp ^= a[k + 1];
    }
    printf("%lld", temp);
    return 0;
}
子任务 #1
Time Limit Exceeded
得分:0
测试点 #1
Time Limit Exceeded
得分:0
用时:1049 ms
内存:1000 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
<679808 bytes omitted>
测试点 #2
Time Limit Exceeded
得分:0
用时:1038 ms
内存:864 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

<688000 bytes omitted>