Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109662 胡海峰老师 外围元素之和 Python3 Accepted 44 MS 3796 KB 477 2025-02-10 13:15:12

Tests(10/10):


Code:

rows , cols = input().split() rows, cols = int(rows),int(cols) # input() split() ,int() a =[] for x in range( rows): b = input().split() for x in range( len(b)): b[x] = int( b[x]) a.append( b ) # [1,2,3,4,5] #数据输入(处理数据) res =0 for x in range(rows): for y in range(cols): if x==0 or y==0 or x==rows-1 or y==cols-1: res += a[x][y] #中间算法设计 print(res) #数据输出