sinderella   1년 전

틀린이유 를 알려주세요

이유요! 분분도 추가하면 감사하겠습니다.

시간복잡도가 O(LN)인데, 일단 L만 봐도 제한이 무지막지하게 크니 시간초과가 나겠죠....

그리고 compare함수를

int compare(const void *a, const void *b) {
long long int x = *(long long int*)a;
long long int y = *(long long int*)b;
if (x < y) return -1;
if (x > y) return 1;
return 0;
}

이렇게 한번 고쳐보세요

sinderella   1년 전

@cute_alpaca_cute_cat님 감사합니다

댓글을 작성하려면 로그인해야 합니다.