| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 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);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
