답안 #14457

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14457 2015-05-17T08:18:54 Z yys980 정전 (OJUZ10_blackout) C++
50 / 100
51 ms 3428 KB
#include <stdio.h>
#include <algorithm>
using namespace std;
int n,l,sum;
int slight[300000],elight[300000];
int main()
{
    scanf("%d %d",&n, &l);
    int i;
    for(i = 1 ; i <= n ; i++){
        scanf("%d",&slight[i]);
        slight[i]-=l;
    }
    sort(slight+1,slight+1+n);
    for(i = 1 ; i <= n ; i++){
        elight[i]=slight[i]+l*2;
    }
    int s=slight[1],x=elight[1];
    for(i = 2 ; i <= n ; i++){
        if(s<slight[i])s=slight[i];
        if(s<=x){
            sum+=x-s;
            s=x;
        }
        x=elight[i];
    }
    printf("%d",sum);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 3428 KB Output is correct
2 Correct 0 ms 3428 KB Output is correct
3 Correct 0 ms 3428 KB Output is correct
4 Correct 0 ms 3428 KB Output is correct
5 Correct 0 ms 3428 KB Output is correct
6 Correct 0 ms 3428 KB Output is correct
7 Incorrect 0 ms 3428 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 3428 KB Output is correct
2 Correct 0 ms 3428 KB Output is correct
3 Correct 0 ms 3428 KB Output is correct
4 Correct 0 ms 3428 KB Output is correct
5 Correct 0 ms 3428 KB Output is correct
6 Correct 0 ms 3428 KB Output is correct
7 Correct 0 ms 3428 KB Output is correct
8 Correct 0 ms 3428 KB Output is correct
9 Correct 0 ms 3428 KB Output is correct
10 Correct 0 ms 3428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 3428 KB Output is correct
2 Correct 40 ms 3428 KB Output is correct
3 Correct 27 ms 3428 KB Output is correct
4 Correct 24 ms 3428 KB Output is correct
5 Correct 26 ms 3428 KB Output is correct
6 Correct 38 ms 3428 KB Output is correct
7 Correct 16 ms 3428 KB Output is correct
8 Correct 38 ms 3428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 3428 KB Output is correct
2 Correct 40 ms 3428 KB Output is correct
3 Correct 33 ms 3428 KB Output is correct
4 Correct 27 ms 3428 KB Output is correct
5 Correct 3 ms 3428 KB Output is correct
6 Correct 28 ms 3428 KB Output is correct
7 Correct 25 ms 3428 KB Output is correct
8 Correct 30 ms 3428 KB Output is correct
9 Correct 34 ms 3428 KB Output is correct
10 Correct 26 ms 3428 KB Output is correct
11 Incorrect 43 ms 3428 KB Output isn't correct
12 Correct 39 ms 3428 KB Output is correct
13 Correct 51 ms 3428 KB Output is correct
14 Correct 30 ms 3428 KB Output is correct
15 Correct 50 ms 3428 KB Output is correct