Submission #159005


Source Code Expand

Copy
#include <stdio.h>

int a[4][4];

int check(int r, int c) {
    if (r > 0 && a[r][c] == a[r-1][c]) return 1;
    if (r < 3 && a[r][c] == a[r+1][c]) return 1;
    if (c > 0 && a[r][c] == a[r][c-1]) return 1;
    if (c < 3 && a[r][c] == a[r][c+1]) return 1;
    return 0;
}

int main() {
    int i,j,c = 0;    
    for (i = 0; i < 4; i++) 
        scanf("%d %d %d %d\n", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
    
    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            if (check(i,j)) {
                c++;
            }
        }
    }

    if (c == 0) printf("GAMEOVER\n");
    else printf("CONTINUE\n");

    return 0;
}

Submission Info

Submission Time
Task A - DEAD END
User shibafu528
Language C (GCC 4.6.4)
Score 100
Code Size 675 Byte
Status
Exec Time 47 ms
Memory 796 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:16:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 hand_1.txt, hand_2.txt, random_1.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_2.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_3.txt, random_30.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt
Case Name Status Exec Time Memory
hand_1.txt 43 ms 692 KB
hand_2.txt 20 ms 796 KB
random_1.txt 47 ms 672 KB
random_10.txt 18 ms 788 KB
random_11.txt 37 ms 712 KB
random_12.txt 20 ms 784 KB
random_13.txt 20 ms 712 KB
random_14.txt 20 ms 716 KB
random_15.txt 20 ms 792 KB
random_16.txt 20 ms 796 KB
random_17.txt 20 ms 792 KB
random_18.txt 20 ms 792 KB
random_19.txt 20 ms 656 KB
random_2.txt 22 ms 664 KB
random_20.txt 34 ms 712 KB
random_21.txt 18 ms 784 KB
random_22.txt 18 ms 792 KB
random_23.txt 20 ms 744 KB
random_24.txt 20 ms 788 KB
random_25.txt 20 ms 788 KB
random_26.txt 21 ms 644 KB
random_27.txt 18 ms 788 KB
random_28.txt 19 ms 792 KB
random_29.txt 23 ms 764 KB
random_3.txt 21 ms 712 KB
random_30.txt 20 ms 788 KB
random_4.txt 21 ms 796 KB
random_5.txt 19 ms 788 KB
random_6.txt 18 ms 784 KB
random_7.txt 20 ms 796 KB
random_8.txt 21 ms 792 KB
random_9.txt 20 ms 784 KB
sample_1.txt 41 ms 672 KB
sample_2.txt 20 ms 792 KB
sample_3.txt 20 ms 796 KB