Skip to content

Commit 0410e18

Browse files
committed
Added 1041A - Heist.cpp
1 parent eb56d79 commit 0410e18

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

1041A - Heist.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int n;
12+
cin >> n;
13+
int mini = INT_MAX, maxi = INT_MIN;
14+
for (int i=0; i<n; i++)
15+
{
16+
int x;
17+
cin >> x;
18+
mini = min(mini, x);
19+
maxi = max(maxi, x);
20+
}
21+
cout<<max(0, (maxi-mini)-n+1);
22+
return 0;
23+
}

0 commit comments

Comments
 (0)