Submission #36959442
Source Code Expand
#include <stdio.h>
// #include <string.h>
int main(void){
int h, w;
scanf("%d %d", &h, &w);
char s;
int cnt = 0;
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
scanf(" %c", &s);
if(s == '#'){
cnt++;
}
}
}
printf("%d\n", cnt);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Pawn on a Grid |
| User | Cebu |
| Language | C (GCC 9.2.1) |
| Score | 100 |
| Code Size | 293 Byte |
| Status | AC |
| Exec Time | 3 ms |
| Memory | 1724 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%d %d", &h, &w);
| ^~~~~~~~~~~~~~~~~~~~~~
./Main.c:11:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
11 | scanf(" %c", &s);
| ^~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 3 ms | 1660 KiB |
| example_01.txt | AC | 1 ms | 1652 KiB |
| example_02.txt | AC | 1 ms | 1656 KiB |
| hand_00.txt | AC | 1 ms | 1724 KiB |
| hand_01.txt | AC | 1 ms | 1652 KiB |
| hand_02.txt | AC | 1 ms | 1724 KiB |
| random_00.txt | AC | 1 ms | 1648 KiB |
| random_01.txt | AC | 1 ms | 1636 KiB |
| random_02.txt | AC | 1 ms | 1724 KiB |
| random_03.txt | AC | 1 ms | 1636 KiB |
| random_04.txt | AC | 2 ms | 1660 KiB |
| random_05.txt | AC | 1 ms | 1648 KiB |