# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14157 | dohyun0324 | 정전 (OJUZ10_blackout) | C++98 | 69 ms | 5184 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.
#include<stdio.h>
#include<algorithm>
using namespace std;
int w,n,l,a[150010],ch[300010];
long long dap;
struct data
{
int pos,sw;
bool operator<(const data&r)const
{
return pos<r.pos;
}
}arr[300010];
int main()
{
int i;
scanf("%d %d",&n,&l);
for(i=1;i<=n;i++) scanf("%d",&a[i]);
for(i=1;i<=n;i++)
{
w++; arr[w].pos=a[i]-l; arr[w].sw=1;
w++; arr[w].pos=a[i]+l; arr[w].sw=-1;
}
sort(arr+1,arr+w+1);
for(i=1;i<=w;i++)
{
ch[i]=ch[i-1]+arr[i].sw;
}
for(i=1;i<=w;i++)
{
# | 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... |