Submission #75874348
Source Code Expand
#include <stdio.h>
int main() {
int H, W;
scanf("%d %d", &H, &W);
for (int i = 1; i <= H; i++) {
for (int j = 1; j <= W; j++) {
int count = 4;
if (i == 1) count--;
if (i == H) count--;
if (j == 1) count--;
if (j == W) count--;
printf("%d", count);
if (j != W) {
printf(" ");
}
}
printf("\n");
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Count Adjacent Cells |
| User | dazzling_dac |
| Language | C23 (GCC 14.2.0) |
| Score | 200 |
| Code Size | 497 Byte |
| Status | AC |
| Exec Time | 0 ms |
| Memory | 1800 KiB |
Compile Error
Main.c: In function ‘main’:
Main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d", &H, &W);
| ^~~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 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, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 0 ms | 1644 KiB |
| 00-sample-02.txt | AC | 0 ms | 1604 KiB |
| 00-sample-03.txt | AC | 0 ms | 1632 KiB |
| 01-01.txt | AC | 0 ms | 1632 KiB |
| 01-02.txt | AC | 0 ms | 1800 KiB |
| 01-03.txt | AC | 0 ms | 1640 KiB |
| 01-04.txt | AC | 0 ms | 1644 KiB |
| 01-05.txt | AC | 0 ms | 1604 KiB |
| 01-06.txt | AC | 0 ms | 1604 KiB |
| 01-07.txt | AC | 0 ms | 1756 KiB |
| 01-08.txt | AC | 0 ms | 1800 KiB |
| 01-09.txt | AC | 0 ms | 1668 KiB |
| 01-10.txt | AC | 0 ms | 1680 KiB |
| 01-11.txt | AC | 0 ms | 1604 KiB |
| 01-12.txt | AC | 0 ms | 1628 KiB |
| 01-13.txt | AC | 0 ms | 1636 KiB |
| 01-14.txt | AC | 0 ms | 1632 KiB |
| 01-15.txt | AC | 0 ms | 1604 KiB |
| 01-16.txt | AC | 0 ms | 1756 KiB |
| 01-17.txt | AC | 0 ms | 1644 KiB |
| 01-18.txt | AC | 0 ms | 1668 KiB |
| 01-19.txt | AC | 0 ms | 1668 KiB |