본문 바로가기
python-algorithm

codeforces 677A - Vanya and Fence

by 무적김두칠 2022. 5. 31.

1
2
3
4
5
6
7
8
9
10
11
def sol(nums,h):
    ans = 0
    for i in nums:
        if i > h:
            ans += 2
        else:
            ans += 1
    print(ans)
n,h=map(int,input().split())
nums=list(map(int, input().split()))
sol(nums,h)
cs
반응형

댓글