일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- springboot3.x
- dp
- nav-tab
- NAV
- MongoDB
- 크롤링
- 13237
- Python
- CSS
- algotythm
- ubuntu
- 2579
- dynaminprogramming
- 라즈베리파이3
- HTML
- Algorythm
- 알고리즘
- 16.04
- 파이썬
- 백준
- node.js
- raspberrypi
- 라즈베리파이
- Crawling
- 라즈비안
- 트리
- 2909
- baekjun
- bootstrap
- 라즈베리파이3b+
Archives
- Today
- Total
목록algotythm (1)
노트
[백준] 1417번 국회의원 선거 python
n = int(input()) dasom = int(input()) vote = [] count = 0 for _ in range(n - 1): vote.append(int(input())) vote.sort(reverse=True) if n == 1: print(0) else: while vote[0] >= dasom: dasom += 1 vote[0] -= 1 count += 1 vote.sort(reverse=True) print(count)
알고리즘
2023. 12. 9. 11:08