# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14018 | pjsdream | 정전 (OJUZ10_blackout) | C++14 | 50 ms | 2256 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma warning(disable:4996)
#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
long long l;
long long a[150000];
long long last[2];
long long mymax(long long a, long long b) { return a>b?a:b; }
int main()
{
scanf("%d%lld", &n, &l);
for (int i=0; i<n; i++) scanf("%lld", &a[i]);
sort(a, a+n);
long long ans=0;
last[0] = last[1] = -1000000000000ll;
for (int i=0; i<n; i++) {
int i0 = i&1;
int i1 = 1-i0;
long long s = mymax(a[i]-l, last[i0]);
long long e = a[i]+l;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |