{"blog_url":"https://ryuichi1208.hateblo.jp/","provider_name":"Hatena Blog","height":"190","description":"n = int(input()) p = list(map(int, input().split())) ans = 0 if n == 2: if p[0] == 1: ans = 0 else: ans = 1 else: for i in range(n): if p[i] == 1: if p[(i+1)%n] == 2: ans = min(i, n-i+2) else: ans = min(n-i,i+2) print(ans) atcoder.jp","url":"https://ryuichi1208.hateblo.jp/entry/2022/01/03/000000","provider_url":"https://hatena.blog","author_name":"ryuichi1208","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fryuichi1208.hateblo.jp%2Fentry%2F2022%2F01%2F03%2F000000\" title=\"ARC 132 B - Shift and Reverse - \u5730\u65b9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u5b66\u7fd2\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","blog_title":"\u5730\u65b9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u5b66\u7fd2\u65e5\u8a18","width":"100%","published":"2022-01-03 00:00:00","categories":["Python"],"version":"1.0","title":"ARC 132 B - Shift and Reverse","image_url":null,"author_url":"https://blog.hatena.ne.jp/ryuichi1208/"}