Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46373 | Songgy_King | 黑白精灵 | C++ | Accepted | 1 MS | 236 KB | 251 | 2024-05-03 11:51:43 |
#include<iostream> using namespace std; int main() { int n,m; cin>>n>>m; int n1,m1,n2,m2; int ans=0; cin>>n1>>m1>>n2>>m2; ans=n+m-2; ans=min(ans,(n1+m1-2)+(n+m-n2-m2)); ans=min(ans,(n2+m2-2)+(n+m-n1-m1)); cout<<ans; return 0; }