Submission #18876694
Source Code Expand
#include <stdio.h>
int main(void){
int h,w,i,j,ans=0,a[100][100],min=100;
scanf("%d %d",&h,&w);
for(i=0;i<h;i++){
for(j=0;j<w;j++){
scanf("%d",&a[i][j]);
if(a[i][j]<min){
min=a[i][j];
}
}
}
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(min<a[i][j]){
ans+=a[i][j]-min;
}
}
}
printf("%d\n",ans);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Blocks on Grid |
| User | spade |
| Language | C (GCC 9.2.1) |
| Score | 200 |
| Code Size | 358 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 1768 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:4:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
4 | scanf("%d %d",&h,&w);
| ^~~~~~~~~~~~~~~~~~~~
./Main.c:7:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d",&a[i][j]);
| ^~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 5 ms | 1768 KiB |
| random_02.txt | AC | 1 ms | 1688 KiB |
| random_03.txt | AC | 4 ms | 1676 KiB |
| random_04.txt | AC | 1 ms | 1676 KiB |
| random_05.txt | AC | 1 ms | 1716 KiB |
| random_06.txt | AC | 1 ms | 1768 KiB |
| random_07.txt | AC | 1 ms | 1688 KiB |
| random_08.txt | AC | 1 ms | 1720 KiB |
| random_11.txt | AC | 4 ms | 1688 KiB |
| random_12.txt | AC | 2 ms | 1668 KiB |
| random_13.txt | AC | 2 ms | 1684 KiB |
| sample_01.txt | AC | 2 ms | 1644 KiB |
| sample_02.txt | AC | 1 ms | 1688 KiB |
| sample_03.txt | AC | 1 ms | 1684 KiB |