From 4ee37a062950d46d4e9bb8bd6ba7dd6aaca17299 Mon Sep 17 00:00:00 2001 From: jichan <66819791+jcdororo@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:01:53 +0900 Subject: [PATCH] =?UTF-8?q?Create=20=EB=A1=9C=ED=94=84=5F=EC=A3=BC?= =?UTF-8?q?=EC=A7=80=EC=B0=AC.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4_\354\243\274\354\247\200\354\260\254.py" | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 "week17/BOJ_2217/\353\241\234\355\224\204_\354\243\274\354\247\200\354\260\254.py" diff --git "a/week17/BOJ_2217/\353\241\234\355\224\204_\354\243\274\354\247\200\354\260\254.py" "b/week17/BOJ_2217/\353\241\234\355\224\204_\354\243\274\354\247\200\354\260\254.py" new file mode 100644 index 0000000..6c875ff --- /dev/null +++ "b/week17/BOJ_2217/\353\241\234\355\224\204_\354\243\274\354\247\200\354\260\254.py" @@ -0,0 +1,31 @@ + +import sys +sys.stdin = open('input.txt') +n = int(sys.stdin.readline()) +arr = [] + +for i in range(n): + arr.append(int(sys.stdin.readline())) + +arr.sort() + +length = len(arr) + + +result = 0 + +for i,j in enumerate(arr): + result = max(result,j*(n-i)) + +print(result) + + + + +# for i,j in enumerate(arr): +# temp = 0 +# for k,l in enumerate(arr): +# if k >= i: +# temp += min(j,l) + +# result = max(result, temp)