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 AC
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]

Judge Result

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