Skip to content

Commit

Permalink
Add 25707.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jul 7, 2024
1 parent 028e307 commit 5c013f8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 25xxx/25707.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

void solve(void) {
int n; cin >> n;
vector<int> v(n);
for (int i=0; i<n; i++) cin >> v[i];

cout << (*max_element(v.begin(), v.end()) - *min_element(v.begin(), v.end())) * 2;
}

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

solve();
return 0;
}

0 comments on commit 5c013f8

Please sign in to comment.