結果
問題 | No.179 塗り分け |
ユーザー | takeya_okino |
提出日時 | 2019-08-03 23:28:48 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,170 bytes |
コンパイル時間 | 1,935 ms |
コンパイル使用メモリ | 73,776 KB |
実行使用メモリ | 58,660 KB |
最終ジャッジ日時 | 2023-09-20 17:54:38 |
合計ジャッジ時間 | 9,913 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 122 ms
56,500 KB |
testcase_01 | WA | - |
testcase_02 | AC | 123 ms
55,588 KB |
testcase_03 | WA | - |
testcase_04 | AC | 123 ms
55,896 KB |
testcase_05 | WA | - |
testcase_06 | AC | 138 ms
56,136 KB |
testcase_07 | WA | - |
testcase_08 | AC | 146 ms
55,760 KB |
testcase_09 | AC | 146 ms
55,884 KB |
testcase_10 | AC | 146 ms
55,864 KB |
testcase_11 | AC | 146 ms
55,748 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 122 ms
55,900 KB |
testcase_16 | AC | 123 ms
55,704 KB |
testcase_17 | WA | - |
testcase_18 | AC | 144 ms
56,120 KB |
testcase_19 | AC | 144 ms
55,568 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 144 ms
56,100 KB |
testcase_24 | WA | - |
testcase_25 | AC | 147 ms
55,700 KB |
testcase_26 | AC | 146 ms
55,740 KB |
testcase_27 | WA | - |
testcase_28 | AC | 145 ms
55,820 KB |
testcase_29 | WA | - |
testcase_30 | AC | 144 ms
55,556 KB |
testcase_31 | WA | - |
testcase_32 | AC | 145 ms
55,196 KB |
testcase_33 | WA | - |
testcase_34 | AC | 144 ms
56,180 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); int[] grid = new int[h * w]; for(int i = 0; i < h; i++) { String s = sc.next(); for(int j = 0; j < w; j++) { if(s.charAt(j) == '#') { grid[w * i + j] = 1; } } } int pp = 0; // 1が黒、2が青、3が赤 for(int s = 0; s < w; s++) { for(int t = 0; t < h; t++) { int[] g = grid; int p = 0; for(int i = 0; i < h; i++) { for(int j = 0; j < w; j++) { int a = i * w + j; if(g[a] == 1) { if(((j + s) < w) && ((i + t) < h)) { int b = (i + t) * w + (j + s); g[a] = 2; if(g[b] == 1) { g[b] = 3; } else { p++; } } else { p++; } } } } if(p == 0) pp++; } } String ans = "NO"; if(pp > 0) ans = "YES"; System.out.println(ans); } }