word = list(input())
result = 1

for i in range(round(len(word)//2)): # 대칭으로 비교하기 때문에, 중간값까지 비교하면 중복없이 비교할 수 있다.
    if word[i] != word[-(i+1)]:
        result=0
        break

print(result)
반응형

'알고리즘' 카테고리의 다른 글

[백준] 28279 덱2  (0) 2023.10.17
[백준] 28278 스택2  (0) 2023.10.17
[백준] 18258 큐2  (0) 2023.10.17
[백준] 13241 최소공배수  (0) 2023.10.17
[백준] 7785 회사에 있는 사람  (0) 2023.10.17

+ Recent posts