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
- epsp
- 고속거듭제곱알고리즘
- Charfield
- 경상국립대학교
- PS
- 다리 놓기
- 7576번
- 백준
- 1010번: 다리 놓기 (Python)
- lgh
- 요세푸스 문제
- NaverCloudPlatform
- 16953
- 백준 토마토
- 문제풀이
- 9735번
- linc3.0
- 그래프 탐색
- 백준 1158번
- max_length
- 백준 7576번
- json
- ncp배포
- 백준 1158
- ncloud서버
- 백준 다리놓기
- python
- Django
- 백준 7576
- 5397
Archives
- Today
- Total
목록다리 놓기 (1)
DolphinDash
백준 1010번: 다리 놓기 (Python)
처음에 봤을 때 막막했는데 경우의 수를 나열했을 때 익숙한 숫자 배열이여서 조합인걸 알았다. 그래서 조합을 사용해서 코드를 짜 봤는데, 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