#include <iostream>
using namespace std;
int main()
{
int n, k, l, x, i, j, s;
cin >> n >> k >> l;
int a[n]={0};
for(i=0;i<k;i++)
{
cin >> x;
for(j=-l;j<=l;j++)
{
if(x+j>=0)
a[x+j]=1;
}
}
s=0;
for(i=0;i<n;i++)
{
if(a[i]==0)
{
for(j=0;j<=2*l;j++)
{
if(i+j<n)
a[i+j]=1;
}
s++;
}
}
cout << s;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Runtime error |
3 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
256 KB |
Output is correct |
8 |
Correct |
2 ms |
256 KB |
Output is correct |
9 |
Correct |
2 ms |
376 KB |
Output is correct |
10 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |