結果

問題 No.2692 How Many Times Reached?
ユーザー トミー
提出日時 2024-03-22 22:05:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 491 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-30 11:35:49
合計ジャッジ時間 2,565 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 40 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=[]
m=n
while m>0:
    s.append(input())
    m-=1
cntx=0
cnty=0

reaches=0
for i in range(n):
    for j in range(n):
        if s[i][j]=="A":
            cntx+=1
        if s[j][i]=="A":
            cnty+=1
    if cntx==n-1:
        reaches+=1
    if cnty==n-1:
        reaches+=1
    cntx=0
    cnty=0

for i in range(n):
    if s[i][i]=="A":
        cntx+=1
    if s[n-1-i][i]=="A":
        cnty+=1
if cntx==n-1:
    reaches+=1
if cnty==n-1:
    reaches+=1
print(reaches)

0