Submission #1480595


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>
static int n, a[100000];
static int cmp(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}
int main(void) {
    int i, j, ans = 1;
    scanf("%d", &n);
    for (i = 0; i < n; ++i) {
        scanf("%d", &j);
        while (1)
            if (j & 1)
                break;
            else
                j >>= 1;
        a[i] = j;
    }
    qsort(a, n, sizeof(int), cmp);
    for (i = 0; i < n - 1; ++i)
        if (a[i] != a[i + 1])
            ++ans;
    printf("%d\n", ans);
    return 0;
}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User test20170101
Language C (GCC 5.4.1)
Score 100
Code Size 575 Byte
Status
Exec Time 26 ms
Memory 892 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:11:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &j);
         ^

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask1 20 / 20 subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask2 30 / 30 subtask2_0.txt, subtask2_1.txt, subtask2_2.txt, subtask2_3.txt, subtask2_4.txt, subtask2_5.txt, subtask2_6.txt, subtask2_7.txt, subtask2_8.txt, subtask2_9.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
All 50 / 50 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt, subtask2_0.txt, subtask2_1.txt, subtask2_2.txt, subtask2_3.txt, subtask2_4.txt, subtask2_5.txt, subtask2_6.txt, subtask2_7.txt, subtask2_8.txt, subtask2_9.txt, subtask3_0.txt, subtask3_1.txt, subtask3_2.txt, subtask3_3.txt, subtask3_4.txt, subtask3_5.txt, subtask3_6.txt, subtask3_7.txt, subtask3_8.txt, subtask3_9.txt
Case Name Status Exec Time Memory
subtask0_0.txt 1 ms 128 KB
subtask0_1.txt 1 ms 128 KB
subtask0_2.txt 1 ms 128 KB
subtask1_0.txt 1 ms 252 KB
subtask1_1.txt 1 ms 252 KB
subtask1_10.txt 1 ms 252 KB
subtask1_11.txt 1 ms 252 KB
subtask1_12.txt 1 ms 128 KB
subtask1_13.txt 1 ms 252 KB
subtask1_14.txt 1 ms 252 KB
subtask1_15.txt 1 ms 252 KB
subtask1_16.txt 1 ms 128 KB
subtask1_17.txt 1 ms 252 KB
subtask1_18.txt 1 ms 252 KB
subtask1_19.txt 1 ms 252 KB
subtask1_2.txt 1 ms 128 KB
subtask1_3.txt 1 ms 252 KB
subtask1_4.txt 1 ms 252 KB
subtask1_5.txt 1 ms 252 KB
subtask1_6.txt 1 ms 128 KB
subtask1_7.txt 1 ms 252 KB
subtask1_8.txt 1 ms 252 KB
subtask1_9.txt 1 ms 252 KB
subtask2_0.txt 15 ms 764 KB
subtask2_1.txt 24 ms 892 KB
subtask2_2.txt 24 ms 892 KB
subtask2_3.txt 24 ms 892 KB
subtask2_4.txt 24 ms 892 KB
subtask2_5.txt 24 ms 892 KB
subtask2_6.txt 24 ms 892 KB
subtask2_7.txt 24 ms 892 KB
subtask2_8.txt 24 ms 892 KB
subtask2_9.txt 24 ms 892 KB
subtask3_0.txt 15 ms 764 KB
subtask3_1.txt 26 ms 892 KB
subtask3_2.txt 26 ms 892 KB
subtask3_3.txt 26 ms 892 KB
subtask3_4.txt 26 ms 892 KB
subtask3_5.txt 26 ms 892 KB
subtask3_6.txt 26 ms 892 KB
subtask3_7.txt 26 ms 892 KB
subtask3_8.txt 26 ms 892 KB
subtask3_9.txt 26 ms 892 KB