본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 26350번 Basket

by 현장 2025. 3. 11.

-Code

x = int(input())
s = int(input())
p = int(input())
res = x if s == 1 else 0

if p == 1:
    t = 1 if s == 1 else x
    for _ in range(t):
        res += int(input())
print(res)