結果
| 問題 | No.3802 Crossword Key |
| ユーザー |
|
| 提出日時 | 2026-11-15 03:33:38 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 59 ms / 2,000 ms |
| + 468µs | |
| コード長 | 968 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 64,644 KB |
| 実行使用メモリ | 59,776 KB |
| 最終ジャッジ日時 | 2026-11-15 03:33:43 |
| 合計ジャッジ時間 | 4,975 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
# https://yukicoder.me/problems/no/3802
def main():
H, W = map(int, input().split())
S = []
for _ in range(H):
S.append(input())
passed = [[False] * W for _ in range(H)]
for h in range(H):
for w in range(W):
if S[h][w] == ".":
new_w0 = w - 1
new_w1 = w + 1
if (not (0 <= new_w0 < W) or S[h][new_w0] == "#") and (0 <= new_w1 < W and S[h][new_w1] == "."):
passed[h][w] = True
new_h0 = h - 1
new_h1 = h + 1
if (not (0 <= new_h0 < H) or S[new_h0][w] == "#") and (0 <= new_h1 < H and S[new_h1][w] == "."):
passed[h][w] = True
answers = []
for h in range(H):
for w in range(W):
if passed[h][w]:
answers.append((h + 1, w + 1))
print(len(answers))
for h, w in answers:
print(h, w)
if __name__ == "__main__":
main()