| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1358109 | kmath628 | 정전 (OJUZ10_blackout) | C++20 | 16 ms | 996 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n,l,i;
ll s=0;
scanf("%d %d",&n,&l);
vector<int> a(n);
for(i=0;i<n;i++) scanf("%d",&a[i]);
sort(a.begin(),a.end());
for(i=0;i<n-1;i++) s+=max(a[i]-a[i+1]+2*l,0);
printf("%lld\n",s);
}
Compilation message (stderr)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
