python-algorithm

백준 12788 제 2회 IUPC는 잘 개최될 수 있을까?

무적김두칠 2022. 1. 1. 18:21

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
n=int(input())
m,k=map(int, input().split())
cntPencil=m*k
ctpList=sorted( list(map(int,input().split())) ,reverse=True)
start=0
currentPencil=0
flag=0
for i in ctpList:
    currentPencil+=i
    start+=1
    if currentPencil>= cntPencil:
        print(start)
        flag=1
        break
if flag==0print("STRESS")
cs
반응형