結果
| 問題 | No.640 76本のトロンボーン | 
| コンテスト | |
| ユーザー |  wajima_wataru | 
| 提出日時 | 2018-03-03 17:17:07 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 1,310 bytes | 
| コンパイル時間 | 84 ms | 
| コンパイル使用メモリ | 12,928 KB | 
| 実行使用メモリ | 11,136 KB | 
| 最終ジャッジ日時 | 2024-06-22 04:21:39 | 
| 合計ジャッジ時間 | 1,308 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 14 WA * 1 | 
ソースコード
N = int(input())
S = []
S_ = [[] for _ in range(N)]
for _ in range(N):
    tmp = []
    for i, c in enumerate(input()):
        tmp.append(c)
        S_[i].append(c)
    S.append(tmp)
num1 = 0
edge = S_[N - 1]
for i, row in enumerate(S):
    if '#' not in row[:N - 1]:
        num1 += 1
    elif '#' not in row[1:]:
        num1 += 1
        edge[i] = '#'
if '#' not in edge[:N - 1] or '#' not in edge[1:]:
    num1 += 1
# print(num1)
num2 = 0
edge = S_[0]
for i, row in enumerate(S):
    if '#' not in row[1:]:
        num2 += 1
    elif '#' not in row[:N - 1]:
        num2 += 1
        edge[i] = '#'
if '#' not in edge[:N - 1] or '#' not in edge[1:]:
    num2 += 1
# print(num2)
num3 = 0
edge = S[N - 1]
for i, row in enumerate(S_):
    if '#' not in row[:N - 1]:
        num3 += 1
    elif '#' not in row[1:]:
        num3 += 1
        edge[i] = '#'
if '#' not in edge[:N - 1] or '#' not in edge[1:]:
    num3 += 1
# print(num3)
num4 = 0
edge = S[0]
for i, row in enumerate(S_):
    if '#' not in row[1:]:
        num4 += 1
    elif '#' not in row[:N - 1]:
        num4 += 1
        edge[i] = '#'
if '#' not in edge[:N - 1] or '#' not in edge[1:]:
    num4 += 1
# print(num4)
num5 = 0
if '#' not in S[0] + S[N-1] + S_[0] + S_[N-1]:
    num5 = 4
# print(num5)
print(max(num1, num2, num3, num4, num5))
            
            
            
        