Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Feb 20, 2025

🧷 문제 링크

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWBnFuhqxE8DFAWr&categoryId=AWBnFuhqxE8DFAWr&categoryType=CODE&problemTitle=%EB%8F%99%EC%95%84%EB%A6%AC&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

  • 네 명의 사람 A, B, C, D가 N일 동안 동아리실을 관리한다.
  • $i$번째 날에 책임자 $T_i$가 한 명씩 존재한다. $(T_i \in$ { $A, B, C, D$ } $)$
  • 첫 날에는 A가 열쇠를 가지고 있고, 어떤 날에 활동에 같이 참여한 사람이 다음 날에도 참여한다면, 그 사람에게 열쇠를 넘겨줄 수 있다.
  • $N$일 동안 활동하는 경우의 수를 구해보자.

🔍 풀이 방법

[사용한 알고리즘]

  • 비트마스킹
  • DP

  • $DP[n][x] = $n번째 날에 활동하는 사람의 집합이 x인 경우의 수라고 정의한다.
  • $DP[n][x] = \sum \limits_{(x \oplus y) \neq (x + y)} DP[n-1][y]$이다.

⏳ 회고

  • 첫 날에는 열쇠를 A가 가지고 있다는 걸 못 보고 풀었더니 값이 너무 크게 나와서 잘못 푼 걸 알았다.

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Feb 20, 2025
@ShinHeeEul ShinHeeEul merged commit d5aeb97 into main Feb 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