Submission #7636920


Source Code Expand

Copy
#include <stdio.h>
#include <stdlib.h>
int main(void){
    // Your code here!
    int H,A,W,B;
    int matrix[1001][1001];
    int i,j;
    int change_flag=1;
    scanf("%d %d %d %d\n",&H,&W,&A,&B);
    for(i=1;H>=i;i++){
        if(i==B+1)    change_flag = 0;
        for(j=1;W>=j;j++){
            if(change_flag){
                if(j<=A){
                    matrix[i][j] = 1;
                }
                else{
                    matrix[i][j] = 0;
                }
            }
            else{
                if(j<=A){
                    matrix[i][j] = 0;
                }
                else{
                    matrix[i][j] = 1;
                }
            }
        }
    }
    
    for(i=1;H>=i;i++){
        for(j=1;W>=j;j++){
            printf("%d",matrix[i][j]);
        }
        printf("\n");
    }
    return 0;
}

Submission Info

Submission Time
Task A - 01 Matrix
User kyurimaki
Language C (GCC 5.4.1)
Score 300
Code Size 886 Byte
Status AC
Exec Time 72 ms
Memory 4992 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 %d %d %d\n",&H,&W,&A,&B);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 14
Set Name Test Cases
Sample sample-01.txt, sample-02.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 128 KB
01-02.txt AC 1 ms 128 KB
01-03.txt AC 1 ms 128 KB
01-04.txt AC 2 ms 3840 KB
01-05.txt AC 1 ms 256 KB
01-06.txt AC 66 ms 4736 KB
01-07.txt AC 2 ms 4096 KB
01-08.txt AC 42 ms 4608 KB
01-09.txt AC 71 ms 4992 KB
01-10.txt AC 72 ms 4992 KB
01-11.txt AC 71 ms 4992 KB
01-12.txt AC 71 ms 4992 KB
sample-01.txt AC 1 ms 128 KB
sample-02.txt AC 1 ms 128 KB