Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46336 | jiabokai | 黑白精灵 | C++ | Accepted | 1 MS | 256 KB | 236 | 2024-05-03 10:11:20 |
#include<bits/stdc++.h> using namespace std; int main() { int n,m,n1,m1,n2,m2,ans1=0,ans2=0; cin>>n>>m; cin>>n1>>m1>>n2>>m2; ans1=(n1-1+m1-1)+(n-n2+m-m2); ans2=(n2-1+m2-1)+(n-n1+m-m1); cout<<min(ans1,ans2); return 0; }