-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweek2.txt
More file actions
44 lines (32 loc) · 882 Bytes
/
week2.txt
File metadata and controls
44 lines (32 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
A, B, C, M = map(int, input().split())
pirodo = 0
work = 0
for i in range(24):
if pirodo + A <= M:
pirodo += A
work += B
else:
if pirodo - C >= 0:
pirodo -= C
else:
pirodo = 0
print(work)
---------------------------------------------
C번
N = int(input())
time = list(map(int, input().split()))
time.sort() # 빨리 인출한사람부터
total_time = 0
current_time = 0
for t in time:
current_time += t # 처리된 인출시간 누적
total_time += current_time # 위 값들의 합
print(total_time) #모든 사람
----------------------------------------------
B번
N = int(input())
houses = list(map(int, input().split()))
houses.sort()
median = houses[(N - 1) // 2]
print(median)
--------------------------------------------