Problem C: 俊俏地鼠的远亲
[Creator : ]
Description
#include <iostream>
using namespace std;
int t[55][55], ans[55][55], n, m;
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cin >> t[i][j];
for (int i = ___; i <= ___; i++)
for (int j = ___; j <= ___; j++) // 枚举第一只
for (int a = ___; a <= ___; a++)
for (int b = ___; b <= ___; b++) // 枚举第二只
if (!(______) && ________) // 这两只地鼠位置不一样,且特征一样
if ((i - a) * (i - a) + (j - b) * (j - b) > ans[i][j]) // 这两只距离比记录的更远
__________________; // 则更新记录
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++)
cout << ans[i][j] << ' ';
cout << endl;
}
return 0;
}
Sample Input Copy
2 4
1 2 3 2
3 2 1 3
Sample Output Copy
5 4 5 5
9 5 5 9
HINT
对于 的数据, 。
对于另外 的数据,有 。
对于另外 的数据,有 。
对于另外 的数据,有 。
对于 的数据,, 。