728x90
반응형
단순 문자열 문제이다.
for _ in range(int(input())):
L, D = input().split('-')
n = int(D)
s = 0
for i in range(3):
s += (ord(L[i])-65) * 26**(2-i)
print("nice" if abs(s-n) <= 100 else "not nice")
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 8558번 Silnia(python) (0) | 2021.02.19 |
---|---|
백준 알고리즘 7891번 Can you add this?(python) (0) | 2021.02.19 |
백준 알고리즘 1673번 치킨 쿠폰(python) (0) | 2021.02.18 |
백준 알고리즘 1668번 트로피 진열(python) (0) | 2021.02.18 |
백준 알고리즘 10419번 지각(python) (0) | 2021.02.18 |