标签:while pac class its clu main ref span href
https://codeforces.ml/contest/1457
给一个n*m的矩阵,问这个矩阵上到(a, b)距离最远的距离是多少?
找四个角即可。
#include <bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d", &t); while(t --){ int ans = 0; int n, m, r, c; scanf("%d%d%d%d", &n, &m, &r, &c); ans = max(n - r, r - 1) + max(m - c, c - 1); printf("%d\n", ans); } return 0; }
Codeforces Round #687 (Div. 2, based on Technocup 2021 Elimination Round 2) A-E
标签:while pac class its clu main ref span href
原文地址:https://www.cnblogs.com/MrIsland/p/14063775.html