結果
問題 | No.179 塗り分け |
ユーザー | YamaKasa |
提出日時 | 2018-07-26 19:55:40 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,222 bytes |
コンパイル時間 | 3,367 ms |
コンパイル使用メモリ | 73,608 KB |
実行使用メモリ | 40,900 KB |
最終ジャッジ日時 | 2023-09-13 18:47:19 |
合計ジャッジ時間 | 12,602 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 121 ms
40,328 KB |
testcase_01 | WA | - |
testcase_02 | AC | 113 ms
39,612 KB |
testcase_03 | WA | - |
testcase_04 | AC | 110 ms
39,776 KB |
testcase_05 | WA | - |
testcase_06 | AC | 117 ms
39,708 KB |
testcase_07 | AC | 191 ms
40,112 KB |
testcase_08 | AC | 208 ms
40,900 KB |
testcase_09 | AC | 194 ms
39,996 KB |
testcase_10 | AC | 204 ms
40,080 KB |
testcase_11 | AC | 193 ms
40,480 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 111 ms
39,080 KB |
testcase_16 | AC | 110 ms
39,656 KB |
testcase_17 | AC | 111 ms
39,488 KB |
testcase_18 | AC | 190 ms
40,620 KB |
testcase_19 | AC | 155 ms
40,140 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 196 ms
40,108 KB |
testcase_24 | WA | - |
testcase_25 | AC | 159 ms
39,724 KB |
testcase_26 | AC | 172 ms
39,504 KB |
testcase_27 | WA | - |
testcase_28 | AC | 184 ms
40,776 KB |
testcase_29 | WA | - |
testcase_30 | AC | 171 ms
40,336 KB |
testcase_31 | WA | - |
testcase_32 | AC | 183 ms
40,464 KB |
testcase_33 | WA | - |
testcase_34 | AC | 188 ms
40,380 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | AC | 110 ms
39,460 KB |
testcase_40 | AC | 115 ms
39,668 KB |
testcase_41 | AC | 114 ms
39,628 KB |
testcase_42 | AC | 109 ms
39,256 KB |
testcase_43 | WA | - |
testcase_44 | AC | 181 ms
40,336 KB |
testcase_45 | AC | 117 ms
39,460 KB |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int H = scan.nextInt(); int W = scan.nextInt(); char c[][] = new char[H][W]; for(int i = 0; i < H; i++) { String s = scan.next(); for(int j = 0; j < W; j++) { c[i][j] = s.charAt(j); } } scan.close(); boolean [][]s = new boolean[H][W]; boolean flag = false; for(int dy = -H; dy <= H; dy++) { for(int dx = -W; dx <= W; dx++) { if(dy == 0 && dx == 0) { continue; } for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { s[i][j] =false; } } for(int y = 0; y < H; y++) { for(int x = 0; x < W; x++) { if(c[y][x] == '#' && s[y][x] == false) { s[y][x] = true; if(y + dy < 0 || y + dy >= H || x + dx < 0 || x + dx >= W) { flag = false; break; } if(c[y + dy][x + dx] == '#' && s[y + dy][x + dx] == false) { s[y + dy][x + dx] = true; flag = true; }else { flag = false; break; } } } if(flag) { System.out.println("YES"); System.exit(0); } } } } System.out.println("NO"); } }