結果

問題 No.2692 How Many Times Reached?
コンテスト
ユーザー sharu
提出日時 2024-03-23 01:17:28
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WJ  
(最新)
AC  
(最初)
実行時間 -
コード長 517 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
最終ジャッジ日時 2026-09-06 18:06:54
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)

ソースコード

diff #
raw source code

n = int(input())
g = [input() for _ in range(n)]
ans = 0
for i in range(n):
    if g[i].count("A") == n - 1 and "B" not in g[i]:
        ans += 1
for j in range(n):
    t = []
    for i in range(n):
        t.append(g[i][j])
    if t.count("A") == n - 1 and "B" not in t:
        ans += 1

t = []
for i in range(n):
    t.append(g[i][i])
if t.count("A") == n - 1 and "B" not in t:
    ans += 1
t = []
for i in range(n):
    t.append(g[i][n - i - 1])
if t.count("A") == n - 1 and "B" not in t:
    ans += 1
print(ans)
0