Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Sep 20, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/34462

🧭 풀이 시간

15분

👀 체감 난이도

✏️ 문제 설명

길이 N인 수열 a에 쿼리를 Q개 처리해보자.

  • 1 x y : a[x] = y로 바꾼다
  • 2 l r : 수열의 [l, r] 구간에 없는 수를 아무거나 출력한다

🔍 풀이 방법

  • 비둘기집 원리

일단 길이가 N이고 수의 범위도 N이라, 각 수가 모두 한 번씩 등장하는 경우가 아니라면 항상 존재하지 않는 수가 있다.
만약 각 수가 모두 한 번씩 등장한다면, 문제 조건에 따라 답이 항상 존재하도록 쿼리가 주어진다고 했으니까 [l, r]에 포함되지 않는 수를 아무거나 하나 출력했다.

⏳ 회고

ez

@oncsr oncsr self-assigned this Sep 20, 2025
@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Sep 20, 2025
@ShinHeeEul ShinHeeEul merged commit 4bcf1d9 into main Sep 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants