Submission #2406732


Source Code Expand

#include <stdio.h>
#include <math.h>
#define min(x, y) (x > y ? y : x)

int main()
{
    int N;
    
    scanf("%d", &N);
    
    int array_a[N];
    int array_b[N];
    int i, j;
    
    for (i = 0; i < N; i++) scanf("%d", &array_a[i]);
    for (i = 0; i < N; i++) scanf("%d", &array_b[i]);
    
    int sum_array[N * N];
    
    for (i = 0; i < N; i++){
        for (j = 0; j < N; j++){
            sum_array[N * i + j] = array_a[i] + array_b[j];
            // printf("%d\n", sum_array[N * i + j]);
        }
    }
    
    int two_array[N * N][28];
    for (i = 0; i < N * N; i++){
        for (j = 0; j < 28; j++){
            two_array[i][j] = sum_array[i] % 2;
            sum_array[i] /= 2;
            // printf("%d\n", two_array[i][j]);
        }
    }
    
    int xor_array[28];
    for (i = 0; i < 28; i++) xor_array[i] = 0;
    // for (i = 0; i < 28; i++) printf("%d", xor_array[i]);
    
    for (i = 0; i < N * N; i++){
        for (j = 0; j < 28; j++){
            xor_array[j] += two_array[i][j];
            // printf("%d",xor_array[j]);
        }
    }
    // printf("%d", two_array[1][1]);
    
    // for (i = 0; i < 28; i++) printf("%d", xor_array[i]);
    
    for (i = 0; i < 28; i++) xor_array[i] %= 2;
    
    int result = 0;
    for (i = 0; i < 28; i++) result += xor_array[i] * (int)pow(2, (double)i);
    
    printf("%d", result);
    
    return 0;
}

Submission Info

Submission Time
Task D - Two Sequences
User Haruyuk1
Language C (GCC 5.4.1)
Score 0
Code Size 1445 Byte
Status RE
Exec Time 172 ms
Memory 164992 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:9:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &N);
     ^
./Main.c:15:29: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     for (i = 0; i < N; i++) scanf("%d", &array_a[i]);
                             ^
./Main.c:16:29: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     for (i = 0; i < N; i++) scanf("%d", &array_b[i]);
                             ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 4
AC × 6
RE × 10
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All 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 RE 122 ms 896 KB
N100000_1 RE 122 ms 896 KB
N150000_0 RE 135 ms 1280 KB
N150000_1 RE 134 ms 1280 KB
N200000_0 RE 145 ms 1664 KB
N200000_1 RE 148 ms 1664 KB
N200000_ex_0 RE 147 ms 1664 KB
N200000_ex_1 RE 148 ms 1664 KB
example_0 AC 2 ms 256 KB
example_1 AC 1 ms 128 KB
example_2 AC 1 ms 128 KB
example_3 AC 1 ms 128 KB
rand_0 RE 172 ms 164992 KB
rand_1 RE 100 ms 256 KB
smallrand_0 AC 1 ms 128 KB
smallrand_1 AC 1 ms 128 KB