kcits970   1년 전

The problem statement does not explain how you should handle inputs with duplicate numbers.

Consider the following input.

4
5 5 1 6

If we ignore duplicate entries and treat them as distinct elements, the answer is 12 (which seems to be the intended answer for this problem).

However, the "real" answer (taking duplicate entries into account) is 6, as listed below.

1 5 5 6
1 5 6 5
5 1 5 6
5 6 5 1
6 5 1 5
6 5 5 1

I verified the existence of such cases with this code: http://boj.kr/8a63f7ccf2374324... (the submission gets accepted if I delete the assert statement).

The accepted code does not consider duplicate elements and will output 12 when provided the above example input.

I think there are 2 ways to resolve this issue.

1. remove all test cases that contain duplicate numbers in the input, and update the problem statement to say that the input contains no duplicates.

2. for all test cases with duplicate numbers, update the intended answer.

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