Submission #1140930
Source Code Expand
#include <stdio.h> char c[51][50]; char b[50][50]; char r[16384][8][2]; int rc; int main(int argc, char *argv[]) { int x, y, k, i; fgets(c[0], 50 * 2, stdin); // skip first line for(y = 0; y < 50; y ++){ fgets(c[y], 50 * 2, stdin); } for(y = 0; y < 50; y++){ for(x = 0; x < 50; x++){ c[y][x] -= '0'; } } // 横方向 for(y = 0; y < 50; y++){ k = 0; for(x = 0; x < 50; x++){ if(c[y][x] == 0){ k = 0; } else{ k++; if(k == 8){ for(i = 0; i < 8; i++){ r[rc][i][0] = x - i; r[rc][i][1] = y; b[y][x - i] = 1; } rc++; k = 0; } } } } // 縦方向 for(x = 0; x < 50; x++){ k = 0; for(y = 0; y < 50; y++){ if(c[y][x] == 0 || b[y][x]){ k = 0; } else{ k++; if(k == 8){ for(i = 0; i < 8; i++){ r[rc][i][0] = x; r[rc][i][1] = y - i; b[y][x] = 1; } rc++; k = 0; } } } } printf("%d\n", rc); for(i = 0; i < rc; i++){ for(x = 0; x < 8; x++){ printf("%d %d\n", r[i][x][1] + 1, r[i][x][0] + 1); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Pieces |
User | hikalium |
Language | C (GCC 5.4.1) |
Score | 69813 |
Code Size | 1139 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:12:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(c[0], 50 * 2, stdin); // skip first line ^ ./Main.c:14:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(c[y], 50 * 2, stdin); ^
Judge Result
Set Name | test_01 | test_02 | test_03 | test_04 | test_05 | test_06 | test_07 | test_08 | test_09 | test_10 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 8172 / 1343058 | 5798 / 1343058 | 9180 / 1343058 | 8290 / 1343058 | 7730 / 1343058 | 6659 / 1343058 | 4689 / 1343058 | 4912 / 1343058 | 6481 / 1343058 | 7902 / 1343058 | ||||||||||||||||||||
Status |
|
|
|
|
|
|
|
|
|
|
Set Name | Test Cases |
---|---|
test_01 | subtask_01_01.txt |
test_02 | subtask_01_02.txt |
test_03 | subtask_01_03.txt |
test_04 | subtask_01_04.txt |
test_05 | subtask_01_05.txt |
test_06 | subtask_01_06.txt |
test_07 | subtask_01_07.txt |
test_08 | subtask_01_08.txt |
test_09 | subtask_01_09.txt |
test_10 | subtask_01_10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
subtask_01_01.txt | AC | 1 ms | 128 KB |
subtask_01_02.txt | AC | 1 ms | 128 KB |
subtask_01_03.txt | AC | 1 ms | 128 KB |
subtask_01_04.txt | AC | 1 ms | 128 KB |
subtask_01_05.txt | AC | 1 ms | 128 KB |
subtask_01_06.txt | AC | 1 ms | 128 KB |
subtask_01_07.txt | AC | 1 ms | 128 KB |
subtask_01_08.txt | AC | 1 ms | 128 KB |
subtask_01_09.txt | AC | 1 ms | 128 KB |
subtask_01_10.txt | AC | 1 ms | 128 KB |