[백준/파이썬] 13155번 풀이

업데이트:



문제 정보


풀이

문제

Alice and Bob play some game in which they score points. Each of the two has an n-digit scoreboard which depicts numbers in base 10 (with leading zeroes). The digits 0 to 9 are displayed on a seven-segment display in the following fashion:

For some odd reason, the two players cannot see the scoreboards entirely. Alice can only see the lower half of her own scoreboard and the upper half of Bob’s scoreboard. Bob can only see the upper half of his scoreboard and the upper half of Alice’s scoreboard. …

입력 요약
The input consists of:

  • one line with an integer n (1 ≤ n ≤ 20), where n is the number of digits.

출력 요약
Output the number of score pairs that can be displayed on two n-digit scoreboards and are fully known by both players.

코드

print(8**int(input()))

설명

핵심은 구현 관점에서 Alice and Bob play some game in which they score points. Each of the two has an n-digit scoreboard which depicts numbers in base 10 (with leading zero …를 만족하도록 로직을 구성하는 것입니다.

코드는 입력을 파싱한 뒤 조건 분기와 계산을 순서대로 수행하고, 문제에서 요구한 형식으로 결과를 출력합니다.

경계값과 예외 케이스도 함께 고려해 오답이 나기 쉬운 상황을 방지합니다.



다음 읽을거리

관련 허브 페이지에서 같은 주제의 글을 이어서 확인할 수 있습니다.

댓글남기기