Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- codeup
- 일상
- 정렬
- 분할메모리할당
- Java
- 리덕스장바구니
- CPU 스케줄링
- 파이썬
- 자료구조
- OS
- Operating System
- 공부
- react
- 기초100제
- Spring
- js to ts
- memory
- 백준
- react-redux
- 프로그래머스
- 알고리즘
- C++
- Redux
- 토이프로젝트
- 타입스크립트
- 스프링
- 코드업
- 협업
- web
- error
Archives
- Today
- Total
목록9375 (1)
감자튀김 공장🍟
[백준/9375] 패션왕 신해빈 (with 파이썬)
✔ 문제 ✔ 풀이 import sys input = sys.stdin.readline t = int(input()) for _ in range(t): n = int(input()) dic = {} for _ in range(n): cloth, category = input().split() if category in dic.keys(): dic[category] += 1 else: dic[category] = 1 res = 1 for key in dic: res *= (dic[key] + 1) print(res - 1) ✔ 설명 조합론 문제이다. 옷의 종류 별로 분류를 하여 (a 종류의 옷 개수 + 1) * (b 종류의 옷 개수 + 1) * ... - 1 (알몸인 경우) 와 같은 식을 세울 수 있다. 딕..
Algorithm/BOJ
2022. 12. 23. 13:38