結果

問題 No.2708 Jewel holder
ユーザー maccha
提出日時 2024-03-31 14:11:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 477 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-09-30 19:06:22
合計ジャッジ時間 1,464 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b=map(int,input().split())
x=[input() for i in range(a)]
y=[]
def f(i,j,n,r):
    if x[i][j]=="o":
        n+=1
    elif x[i][j]=="x":
        n-=1
    else:
        return 0
    r+=[[i,j,n]]
    if i==a-1 and j==b-1:
        if n>=0:
            y.append("A")
            #print(r)
            r=[]
            return 0
    else:
        if n>=0:
            if i<a-1:
                f(i+1,j,n,r)
            if j<b-1:
                f(i,j+1,n,r)
f(0,0,0,[])
print(len(y))
0