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
문제 조건
부등호 '<', '>'가 k개 나열된 순서열 A가 있을 때 이 부등호 앞뒤로 서로 다른 한 자리의 수를 넣어서 모든 부등호 관계를 만족시켜야 한다.
아이디어
부등호의 개수가 k개이면 k+1개의 수를 뽑아야 한다.
0~9까지의 수 중 k+1개의 수를 중복없이 순서있게 뽑는 순열 문제이다.
뽑은 뒤 조건을 만족하는지 판단한 후 list에 넣는다.
최솟값과 최댓값은 list의 첫 번째 원소와 마지막 원소이므로 답을 구할 수 있다.
구현
All reactions