# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
16622 |
2015-08-29T16:03:57 Z |
eaststar |
정전 (OJUZ10_blackout) |
C++14 |
|
65 ms |
2308 KB |
#include <bits/stdc++.h>
using namespace std;
int a[150010];
long long ans;
int main(){
int i,n,l,s,e,t=-2e9;
scanf("%d%d",&n,&l);
for(i=0;i<n;++i)scanf("%d",a+i);
sort(a,a+n);
for(i=1;i<n;++i){
s=a[i]-l,e=a[i-1]+l;
if(s<e)ans+=e-max(s,t),t=e;
}
printf("%lld",ans);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2308 KB |
Output is correct |
2 |
Correct |
0 ms |
2308 KB |
Output is correct |
3 |
Correct |
0 ms |
2308 KB |
Output is correct |
4 |
Correct |
0 ms |
2308 KB |
Output is correct |
5 |
Correct |
0 ms |
2308 KB |
Output is correct |
6 |
Correct |
0 ms |
2308 KB |
Output is correct |
7 |
Correct |
0 ms |
2308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2308 KB |
Output is correct |
2 |
Correct |
1 ms |
2308 KB |
Output is correct |
3 |
Correct |
0 ms |
2308 KB |
Output is correct |
4 |
Correct |
0 ms |
2308 KB |
Output is correct |
5 |
Correct |
0 ms |
2308 KB |
Output is correct |
6 |
Correct |
0 ms |
2308 KB |
Output is correct |
7 |
Correct |
0 ms |
2308 KB |
Output is correct |
8 |
Correct |
1 ms |
2308 KB |
Output is correct |
9 |
Correct |
0 ms |
2308 KB |
Output is correct |
10 |
Correct |
0 ms |
2308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2308 KB |
Output is correct |
2 |
Correct |
17 ms |
2308 KB |
Output is correct |
3 |
Correct |
28 ms |
2308 KB |
Output is correct |
4 |
Correct |
30 ms |
2308 KB |
Output is correct |
5 |
Correct |
48 ms |
2308 KB |
Output is correct |
6 |
Correct |
59 ms |
2308 KB |
Output is correct |
7 |
Correct |
34 ms |
2308 KB |
Output is correct |
8 |
Correct |
28 ms |
2308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
2308 KB |
Output is correct |
2 |
Correct |
48 ms |
2308 KB |
Output is correct |
3 |
Correct |
25 ms |
2308 KB |
Output is correct |
4 |
Correct |
46 ms |
2308 KB |
Output is correct |
5 |
Correct |
58 ms |
2308 KB |
Output is correct |
6 |
Correct |
0 ms |
2308 KB |
Output is correct |
7 |
Correct |
29 ms |
2308 KB |
Output is correct |
8 |
Correct |
48 ms |
2308 KB |
Output is correct |
9 |
Correct |
32 ms |
2308 KB |
Output is correct |
10 |
Correct |
65 ms |
2308 KB |
Output is correct |
11 |
Correct |
57 ms |
2308 KB |
Output is correct |
12 |
Correct |
29 ms |
2308 KB |
Output is correct |
13 |
Correct |
42 ms |
2308 KB |
Output is correct |
14 |
Correct |
58 ms |
2308 KB |
Output is correct |
15 |
Correct |
37 ms |
2308 KB |
Output is correct |