From 6e0107e87f93c1b8861b09f8d6e331b1bd4f16fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84=20KimDohyun?= <202230418@pukyong.ac.kr> Date: Thu, 11 Apr 2024 00:18:04 +0900 Subject: [PATCH 1/2] 2024-04-10 --- pu2rile/README.md | 2 ++ ...0\354\233\220 \354\204\240\352\261\260.py" | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 "pu2rile/\352\267\270\353\246\254\353\224\224 \354\225\214\352\263\240\353\246\254\354\246\230/\352\265\255\355\232\214\354\235\230\354\233\220 \354\204\240\352\261\260.py" diff --git a/pu2rile/README.md b/pu2rile/README.md index 1a26feb..b2d8dfe 100644 --- a/pu2rile/README.md +++ b/pu2rile/README.md @@ -5,3 +5,5 @@ | 1차시 | 2024.03.24 | DP | [평범한 배낭](https://www.acmicpc.net/problem/12865) | [#3](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/3#issue-2205834078)| | 2차시 | 2024.03.29 | 구현 | [OX퀴즈](https://www.acmicpc.net/problem/8958) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/6#issue-2214931034)| | 3차시 | 2024.04.02 | 문자열 | [크로아티아 알파벳](https://www.acmicpc.net/problem/8958) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/10#issue-2220631332) +| 4차시 | 2024.04.08 | 스택 | [제로](https://www.acmicpc.net/problem/10773) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/15#issue-2229909173) +| 5차시 | 2024.04.10 | 그리디 알고리즘 | [국회의원 선거](https://www.acmicpc.net/problem/1417) | [#]() \ No newline at end of file diff --git "a/pu2rile/\352\267\270\353\246\254\353\224\224 \354\225\214\352\263\240\353\246\254\354\246\230/\352\265\255\355\232\214\354\235\230\354\233\220 \354\204\240\352\261\260.py" "b/pu2rile/\352\267\270\353\246\254\353\224\224 \354\225\214\352\263\240\353\246\254\354\246\230/\352\265\255\355\232\214\354\235\230\354\233\220 \354\204\240\352\261\260.py" new file mode 100644 index 0000000..4b4996f --- /dev/null +++ "b/pu2rile/\352\267\270\353\246\254\353\224\224 \354\225\214\352\263\240\353\246\254\354\246\230/\352\265\255\355\232\214\354\235\230\354\233\220 \354\204\240\352\261\260.py" @@ -0,0 +1,19 @@ +N = int(input()) +dasom = int(input()) +vote = [] +cnt = 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 + cnt += 1 + vote.sort(reverse=True) + print(cnt) From 2c3fe2f5d63c66a5e1648522d5231d9c2beceaf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84=20KimDohyun?= <163822282+pu2rile@users.noreply.github.com> Date: Fri, 10 May 2024 16:03:17 +0900 Subject: [PATCH 2/2] Update README.md --- pu2rile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pu2rile/README.md b/pu2rile/README.md index b2d8dfe..71080ed 100644 --- a/pu2rile/README.md +++ b/pu2rile/README.md @@ -6,4 +6,4 @@ | 2차시 | 2024.03.29 | 구현 | [OX퀴즈](https://www.acmicpc.net/problem/8958) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/6#issue-2214931034)| | 3차시 | 2024.04.02 | 문자열 | [크로아티아 알파벳](https://www.acmicpc.net/problem/8958) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/10#issue-2220631332) | 4차시 | 2024.04.08 | 스택 | [제로](https://www.acmicpc.net/problem/10773) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/15#issue-2229909173) -| 5차시 | 2024.04.10 | 그리디 알고리즘 | [국회의원 선거](https://www.acmicpc.net/problem/1417) | [#]() \ No newline at end of file +| 5차시 | 2024.04.10 | 그리디 알고리즘 | [국회의원 선거](https://www.acmicpc.net/problem/1417) | [#18](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/18#issue-2235862658)