結果
| 問題 | No.2708 Jewel holder |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-01 20:45:52 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 260 ms / 2,000 ms |
| + 920µs | |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 38,528 KB |
| 最終ジャッジ日時 | 2026-10-21 03:28:07 |
| 合計ジャッジ時間 | 2,786 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
from collections import deque h,w=map(int,input().split()) a=[list(input()) for _ in range(h)] roots=deque([[(0,0,1)]]) count=0 while roots: t=roots.popleft() x,y,c=t[-1] if x==h-1 and y==w-1: count+=1 continue if x+1<h and ( a[x+1][y]=="o" or ( a[x+1][y]=="x" and c>0 ) ): d= c-1 if a[x+1][y]=="x" else c+1 g=t.copy() g.append((x+1,y,d)) roots.append(g) if y+1<w and ( a[x][y+1]=="o" or ( a[x][y+1]=="x" and c>0 ) ): d= c-1 if a[x][y+1]=="x" else c+1 g=t.copy() g.append((x,y+1,d)) roots.append(g) print(count)