๋ฌธ์
https://www.acmicpc.net/problem/13335
ํ์ด
# ๋ฐฑ์ค 13335๋ฒ ๋ฌธ์ - ํธ๋ญ
n, w, l = map(int, input().split())
trucks = list(map(int, input().split()))
bridge = [0] * w
time = 0
while bridge:
time += 1
bridge.pop(0)
if trucks:
if sum(bridge) + trucks[0] <= l:
bridge.append(trucks.pop(0))
else:
bridge.append(0)
print(time)
'๐๏ธ Algorithm > ๐ฉ ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๐ฉ [๋ฐฑ์ค] [Java] [Silver5] 1316๋ฒ_๊ทธ๋ฃน ๋จ์ด ์ฒด์ปค (1) | 2023.12.08 |
---|---|
๐ฉ [๋ฐฑ์ค] [Java] [Silver5] 4673๋ฒ_์ ํ ๋๋ฒ (0) | 2023.12.07 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold4] 15685๋ฒ_๋๋๊ณค ์ปค๋ธ (0) | 2023.06.26 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold5] 14719๋ฒ_๋น๋ฌผ (0) | 2023.06.21 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold3] 14890๋ฒ_๊ฒฝ์ฌ๋ก (0) | 2023.06.19 |