Submission #2251371


Source Code Expand

Copy
#include <cstdio>
#include <cstdlib>

__attribute__((target("avx"))) int main() {
    int n;
    int a[200000], b[200000];

    scanf("%d", &n);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    for (int i = 0; i < n; i++) {
        scanf("%d", b + i);
    }

    int ans = 0;

    int m = n / 6 * 6;

    for (int i = 0; i < m; i += 6) {
        const int a0 = a[i];
        const int a1 = a[i + 1];
        const int a2 = a[i + 2];
        const int a3 = a[i + 3];
        const int a4 = a[i + 4];
        const int a5 = a[i + 5];

        for (int j = 0; j < n; j++) {
            ans ^= a0 + b[j];
            ans ^= a1 + b[j];
            ans ^= a2 + b[j];
            ans ^= a3 + b[j];
            ans ^= a4 + b[j];
            ans ^= a5 + b[j];
        }
    }

    for (int i = m; i < n; i++) {
        for (int j = 0; j < n; j++) {
            ans ^= a[i] + b[j];
        }
    }

    printf("%d\n", ans);
}

Submission Info

Submission Time
Task D - Two Sequences
User mino
Language C++14 (Clang 3.8.0)
Score 500
Code Size 988 Byte
Status
Exec Time 2908 ms
Memory 1792 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0, example_1, example_2, example_3
All 500 / 500 N100000_0, N100000_1, N150000_0, N150000_1, N200000_0, N200000_1, N200000_ex_0, N200000_ex_1, example_0, example_1, example_2, example_3, rand_0, rand_1, smallrand_0, smallrand_1
Case Name Status Exec Time Memory
N100000_0 736 ms 1024 KB
N100000_1 742 ms 1024 KB
N150000_0 1638 ms 1408 KB
N150000_1 1642 ms 1408 KB
N200000_0 2904 ms 1792 KB
N200000_1 2903 ms 1792 KB
N200000_ex_0 2903 ms 1792 KB
N200000_ex_1 2908 ms 1792 KB
example_0 1 ms 256 KB
example_1 1 ms 256 KB
example_2 1 ms 256 KB
example_3 1 ms 256 KB
rand_0 6 ms 256 KB
rand_1 18 ms 384 KB
smallrand_0 1 ms 256 KB
smallrand_1 1 ms 256 KB