답안 #145492

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
145492 2019-08-20T08:58:37 Z charlies_moo Rasvjeta (COCI17_rasvjeta) C++
10 / 50
1000 ms 380 KB
#include <iostream>
using namespace std;
int main(){
    int n,k,l,i,j;
    int a[4000]={0};
    cin >>n>>k>>l;
    int x;
    for(i=0;i<k;i++){
        cin >>x;
        for(j=x-l;j<=x+l;j++){
            a[j]=1;
        }
    }
    int s=0;
    while(i<n){
        if(a[i]==0){
            for(j=i;j<=i+2*l;j++){
                a[j]=1;
            }
            s++;
            i=j;
        }
    }
    cout <<s;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1058 ms 376 KB Time limit exceeded
2 Incorrect 2 ms 372 KB Output isn't correct
3 Incorrect 3 ms 380 KB Output isn't correct
4 Execution timed out 1082 ms 376 KB Time limit exceeded
5 Execution timed out 1086 ms 376 KB Time limit exceeded
6 Execution timed out 1067 ms 376 KB Time limit exceeded
7 Execution timed out 1080 ms 376 KB Time limit exceeded
8 Correct 2 ms 380 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Execution timed out 1077 ms 256 KB Time limit exceeded