diff --git a/pu2rile/README.md b/pu2rile/README.md index f04c429..d512921 100644 --- a/pu2rile/README.md +++ b/pu2rile/README.md @@ -6,3 +6,8 @@ | 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) +<<<<<<< Updated upstream +======= +| 5차시 | 2024.04.10 | 그리디 알고리즘 | [국회의원 선거](https://www.acmicpc.net/problem/1417) | [#18](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/18#issue-2235862658) +| 6차시 | 2024.05.10 | 그리디 알고리즘 | [ATM](https://www.acmicpc.net/problem/11399) | [#]() +>>>>>>> Stashed changes 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/ATM.py" "b/pu2rile/\352\267\270\353\246\254\353\224\224 \354\225\214\352\263\240\353\246\254\354\246\230/ATM.py" new file mode 100644 index 0000000..042c305 --- /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/ATM.py" @@ -0,0 +1,9 @@ +num = int(input()) +arr = list(map(int, input().split())) +arr.sort() #입력받은 정수 오름차순 정렬 +result = 0 +time = 0 +for i in range(num): + time += arr[i] #현재 사람이 기다리는 시간을 계산해서 time에 더함 + result += time #현재 사람까지의 총 대기 시간을 결과에 더함 +print(result) \ No newline at end of file