結果
| 問題 | No.2692 How Many Times Reached? | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-03-22 22:15:48 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 693 bytes | 
| コンパイル時間 | 214 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-30 11:44:13 | 
| 合計ジャッジ時間 | 2,495 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 1 | 
| other | AC * 34 WA * 9 | 
ソースコード
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
        elif s[i][j]=="B":
            cntx=-1000
        if s[j][i]=="A":
            cnty+=1
        elif s[i][j]=="B":
            cnty=-1000
    if cntx==n-1:
        reaches+=1
    if cnty==n-1:
        reaches+=1
    cntx=0
    cnty=0
cntx=0
cnty=0
for i in range(n):
    if s[i][i]=="A":
        cntx+=1
    elif s[i][i]=="B":
        cntx=-1000
    if s[i][n-1-i]=="A":
        cnty+=1
    elif s[i][n-1-i]=="B":
        cnty=-1000
if cntx==n-1:
    reaches+=1
if cnty==n-1:
    reaches+=1
print(reaches)
            
            
            
        