답안 #14054

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14054 2015-04-26T01:55:31 Z kipa00 이상한 수열 (OJUZ10_bizarre) C++
0 / 100
16 ms 1600 KB
#include <cstdio>
#include <algorithm>
using namespace std;

int arr[50000];
int main() {
    int N, i, differ = 1, sup = -1000001, ord, tst;
    scanf("%d", &N);
    for (i=0; i<N; ++i) {
        scanf("%d", arr+i);
    }
    stable_sort(arr, arr+N);
    for (i=1; i<N; ++i) {
        differ += (arr[i] != arr[i - 1]);
    }
    for (i=0; i<N; ++i) {
        if (arr[i] >= differ) {
            sup = arr[i];
            break;
        }
    }
    scanf("%d", &ord);
    tst = ord - (N + 1) + differ;
    if (tst >= sup) tst = sup;
    printf("%d\n", tst);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1408 KB Output isn't correct
2 Incorrect 0 ms 1408 KB Output isn't correct
3 Incorrect 0 ms 1408 KB Output isn't correct
4 Incorrect 0 ms 1408 KB Output isn't correct
5 Incorrect 0 ms 1408 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1408 KB Output isn't correct
2 Incorrect 0 ms 1408 KB Output isn't correct
3 Correct 0 ms 1408 KB Output is correct
4 Correct 0 ms 1408 KB Output is correct
5 Correct 0 ms 1408 KB Output is correct
6 Correct 0 ms 1408 KB Output is correct
7 Incorrect 0 ms 1408 KB Output isn't correct
8 Correct 0 ms 1408 KB Output is correct
9 Incorrect 0 ms 1408 KB Output isn't correct
10 Correct 0 ms 1408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1408 KB Output is correct
2 Incorrect 14 ms 1600 KB Output isn't correct
3 Incorrect 16 ms 1600 KB Output isn't correct
4 Incorrect 6 ms 1564 KB Output isn't correct
5 Incorrect 6 ms 1408 KB Output isn't correct
6 Incorrect 15 ms 1600 KB Output isn't correct
7 Correct 3 ms 1408 KB Output is correct
8 Incorrect 8 ms 1600 KB Output isn't correct
9 Incorrect 0 ms 1408 KB Output isn't correct
10 Incorrect 12 ms 1600 KB Output isn't correct
11 Correct 0 ms 1408 KB Output is correct
12 Incorrect 10 ms 1592 KB Output isn't correct
13 Incorrect 14 ms 1600 KB Output isn't correct
14 Incorrect 10 ms 1600 KB Output isn't correct
15 Incorrect 8 ms 1556 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1408 KB Output isn't correct
2 Correct 14 ms 1600 KB Output is correct
3 Correct 15 ms 1600 KB Output is correct
4 Incorrect 7 ms 1556 KB Output isn't correct
5 Incorrect 3 ms 1408 KB Output isn't correct
6 Incorrect 10 ms 1600 KB Output isn't correct
7 Correct 0 ms 1408 KB Output is correct
8 Incorrect 12 ms 1600 KB Output isn't correct
9 Correct 0 ms 1408 KB Output is correct
10 Incorrect 10 ms 1592 KB Output isn't correct
11 Incorrect 9 ms 1600 KB Output isn't correct
12 Correct 3 ms 1408 KB Output is correct
13 Incorrect 10 ms 1600 KB Output isn't correct
14 Incorrect 6 ms 1564 KB Output isn't correct
15 Correct 14 ms 1600 KB Output is correct