結果
| 問題 | No.2692 How Many Times Reached? | 
| コンテスト | |
| ユーザー |  navel_tos | 
| 提出日時 | 2024-03-22 22:58:18 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 48 ms / 2,000 ms | 
| コード長 | 429 bytes | 
| コンパイル時間 | 396 ms | 
| コンパイル使用メモリ | 82,064 KB | 
| 実行使用メモリ | 62,192 KB | 
| 最終ジャッジ日時 | 2024-09-30 12:20:31 | 
| 合計ジャッジ時間 | 3,479 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 43 | 
ソースコード
N = int(input())
G = [list(input()) for _ in range(N)]
def check(S):
    a = b = c = 0
    for i in S:
        if i == 'A': a += 1
        if i == 'B': b += 1
        if i == '.': c += 1
    return a == N - 1 and c == 1
ans = sum(check(G[h]) for h in range(N))
ans += sum(check([G[h][w] for h in range(N)]) for w in range(N))
ans += check([G[i][i] for i in range(N)])
ans += check([G[i][N - i - 1] for i in range(N)])
print(ans)
            
            
            
        