2023-03-11から1日間の記事一覧

ABC293C - Make Takahashi Happy

考え方 回答例 考え方全通りの経路を再帰でみていけば良い.回答例 H, W = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(H)] def f(x, y, seen): global ans if x == H - 1 and y == W - 1: ans += 1 return if x + 1 < …