Codeforces Round #161 (Div. 2)
はい。
ちょっと2週間ほどプログラミングしないで遊んでました。
http://codeforces.com/contest/263
A. Beautiful Matrix
ざっくりと大意
・5x5のマトリックスで0が24個と1が1個ある
・横に隣り合わせか縦に隣り合わせかを入替でswap交換して、1を中央に位置させるのに何手必要か??
方針のようなもの
・1,5なら2手必要、2,4なら1手必要なのを行と列の両方見ればいいかな
ans=chk=0 for i in xrange(5): n=map(int,raw_input().split()) if 1 in n: ans+=abs(2-n.index(1)) ans+=abs(2-i) print ans