-Code
points = {1: 0, 2: 0, 4: 0, 8: 0, 16: 0, 32: 0, 64: 0, 128: 0,
256: 0, 512: 0}
point = 512
a, b = map(int, input().split())
for p in range(10):
if a // point > 0:
points[point] += 1
a -= point
if b // point > 0:
points[point] += 1
b -= point
point //= 2
res = 0
for key,val in points.items():
if val == 1:
res += key
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 28295번 체육은 코딩과목 입니다 (0) | 2023.07.11 |
---|---|
[백준/파이썬] 27386번 Class Field Trip (0) | 2023.07.10 |
[백준/파이썬] 14547번 X X glued (0) | 2023.07.08 |
[백준/파이썬] 24073번 ビ太郎と IOI (Bitaro and IOI) (0) | 2023.07.07 |
[백준/파이썬] 17851번 This Problem’s a Slam Dunk (0) | 2023.07.06 |