Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46404 zhouhuanyu 玙静 黑白精灵 C++ 通过 1 MS 244 KB 279 2024-05-03 15:08:48

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; int ans1 = (x1 + y1 - 2) + (n - x2 + m - y2); int ans2 = (x2 + y2 - 2) + (n - x1 + m - y1); cout << min(ans1, ans2); return 0; }


测评信息: