Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
87578 | 胡海峰老师 | 对角线之和 | Python3 | Accepted | 41 MS | 3780 KB | 262 | 2024-08-10 19:55:14 |
n = int(input()) a = [ list(map(int, input().split() )) for x in range(n) ] res = 0 for x in range(n): for y in range(n): if x==y: res = res + a[x][y] elif x+y == n-1: res = res + a[x][y] print(res)