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 | 29 | 30 |
Tags
- max_length
- 백준 7576
- 그래프 탐색
- Charfield
- 7576번
- 다리 놓기
- 16953
- linc3.0
- Django
- python
- PS
- 백준 1158번
- 요세푸스 문제
- ncp배포
- json
- 백준 토마토
- 경상국립대학교
- 고속거듭제곱알고리즘
- 백준
- lgh
- 백준 다리놓기
- NaverCloudPlatform
- 백준 7576번
- epsp
- 5397
- 문제풀이
- 1010번: 다리 놓기 (Python)
- ncloud서버
- 백준 1158
- 9735번
Archives
- Today
- Total
목록백준 다리놓기 (1)
DolphinDash

처음에 봤을 때 막막했는데 경우의 수를 나열했을 때 익숙한 숫자 배열이여서 조합인걸 알았다. 그래서 조합을 사용해서 코드를 짜 봤는데, import itertools N = int(input()) for i in range(N): a, b = map(int, input().split()) nCr = itertools.combinations([f"{i}" for i in range(b)], a) print(len(list(nCr))) 오른쪽 다리의 최대 갯수가 30개인걸 생각하면 조합을 사용해서는 시간 초과가 나올 것이 분명해서 그냥 식을 써봤다. import sys sys.getrecursionlimit = 1000000 N = int(input()) def nCr(n, r): return (fac(n)..
PS/Solve
2023. 5. 23. 00:17