计算矩阵边缘元素之和
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
输入一个整数矩阵,计算位于矩阵边缘的元素之和。
所谓矩阵边缘的元素,就是第一行和最后一行的元素以及第一列和最后一列的元素。
输入格式
第 行包含两个整数,分别为行数 和列数 ,两个整数之间空格隔开。
第 行开始有 行数据,每行包含 个整数,整数之间空格隔开。
输出格式
对应矩阵的边缘元素和。
输入输出样例 #1
输入 #1
3 3
3 4 1
3 7 1
2 0 1
输出 #1
15
说明/提示
。保证答案在 int 范围内。
龙凤苑中学3.14
- Status
- Done
- Rule
- IOI
- Problem
- 3
- Start at
- 2025-3-14 17:00
- End at
- 2025-3-14 19:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 27