Skip to content

Commit

Permalink
Add 15751.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Feb 18, 2024
1 parent c81e8a0 commit 7b286f7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 15xxx/15751.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;

void solve(void) {
int a, b, x, y; cin >> a >> b >> x >> y;

cout << min(abs(b-a), abs(min(a, b)-min(x, y))+abs(max(a, b)-max(x, y)));
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit 7b286f7

Please sign in to comment.