結果

問題 No.3802 Crossword Key
コンテスト
ユーザー Kohei
提出日時 2026-11-15 17:26:10
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 580 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 64,100 KB
実行使用メモリ 60,532 KB
最終ジャッジ日時 2026-11-15 17:26:18
合計ジャッジ時間 4,588 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

H, W = map(int, input().split())
G = [['#'] * (W + 1) for _ in range(H + 1)]
for i in range(1, H + 1):
    s = input()
    for j in range(W):
        G[i][j + 1] = s[j]

ans = set()
for i in range(1, H + 1):
    for j in range(1, W):
        # 左が# で 右が . な . のマス
        if G[i][j - 1] == '#' and G[i][j] == '.' and G[i][j + 1] == '.':
            ans.add((i, j))

for j in range(1, W + 1):
    for i in range(1, H):
        if G[i - 1][j] == '#' and G[i][j] == '.' and G[i + 1][j] == '.':
            ans.add((i, j))

print(len(ans))
for a in ans:
    print(*a)
0