ABBYY Cup 2.0 - Easy
はい。
http://codeforces.com/contest/177
A1. Good Matrix Elements
A2. Good Matrix Elements
implementation
ざっくりと大意
・n*nの正方形の中点を通る縦横斜めの4本の線で通るマスの数の和がいくらか??
方針のようなもの
・最大でも101*101の四角なら何の省略も考えずに足していって通過済みマスは0にしていっても2000ms余裕で間に合うと思う
n=int(raw_input()) l=[] for i in range(n): w=map(int, raw_input().split()) l.append(w) ans=chk=0 for i in range(4): for j in range(n): if i==0: ans+=l[n/2][j] l[n/2][j]=0 elif i==1: ans+=l[j][j] l[j][j]=0 elif i==2: ans+=l[j][n/2] l[j][n/2]=0 else: ans+=l[-1-j][j] l[-1-j][j]=0 print ans