# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
85833 | kraljlavova1 | Rasvjeta (COCI17_rasvjeta) | C++11 | 3 ms | 640 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<bits/stdc++.h>
using namespace std;
const int MAX=1010;
int n,m,k,x,s,sol;
int r[MAX];
int main(){
cin>>n>>m>>k;
for(int i=0;i<m;i++){
cin>>x;x--;
r[max(0,x-k)]++;
r[min(n,x+k+1)]--;
}
for(int i=0;i<n;i++){
s+=r[i];
if(!s){
sol++;
s++;
r[i+2*k+1]--;
}
}
cout<<sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |