Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
69048 张康楠 外围元素之和 Python3 Accepted 34 MS 3784 KB 365 2024-03-30 11:44:02

Tests(10/10):


Code:

row,col = input().split() row = int(row) col = int(col) a=[] for i in range(row): tmp=input().split() tmp=[int(x) for x in tmp] a.append(tmp) res=0 for i in range(row): for j in range(col): if i==0 or i ==row-1: res = res + a[i][j] elif j == 0 or j == col - 1: res = res +a[i][j] print(res)