Run ID:109671

提交时间:2025-02-10 13:41:26

rows,cols=map( int, input().split()) #地图Noun Verb:映射 # a=[ [ int(t) for t in input().split()] for x in range(rows) ] #二维列表生成式 a = [ list(map(int, input().split())) for x in range(rows)] #1维列表生成式 + map函数的使用 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)