题目:1737. 传送
题解:有三种方法。第一种:直接从a到b;第二种:从a到c,再从d到b;第三种:从a到d,再从c到b
#include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<int ,int> PII;
const int N=1e5+10;
const int mod=100000007;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
int t=abs(a-b);
t=min(t,abs(a-c)+abs(d-b));
t=min(t,abs(a-d)+abs(c-b));
cout<<t;
return 0;
}