You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
문제 : https://www.acmicpc.net/problem/2529

아이디어
탐색
일단 조건을 생각하지 말고 0~9까지의 숫자를 중복없이 순서있게 나열한다.
조건
완성된 숫자의 조합이 부등호 사이에 들어갔을 때 참인 경우만 ArrayList에 담아준다.
출력
탐색할 때 오름차순으로 순차적으로 탐색했으므로 ArrayList에 들어간 문자열들도 정렬되어있는 상태일 것이다.
따라서 최대/최소 값은 ArrayList의 끝/처음 값이다.
개삽질의 삽질의 삽질의 연속으로 2시간 걸려서 풀었다.. ㅠㅠ
시간복잡도
N의 최댓값은 9이므로 최대 10개의 수를 중복없이 순차적으로 나열한 순열문제라서 아무리 오래 걸려봐야 10! 미만일 것이므로 가능한 접근법이다.
Beta Was this translation helpful? Give feedback.
All reactions