Submission #21668219


Source Code Expand

import sys


def is_palindrome(input_string):
    return input_string == input_string[::-1]


n = input()
# 最初に回文か判定
if is_palindrome(n):
    print("Yes")
else:
    if not n.endswith("0"):
        print("No")
    else:
        nx = n[::-1]
        for i in range(9):
            nx = list(nx)
            nx.append("0")
            nx = "".join(nx)
            if is_palindrome(nx):
                print("Yes")
                sys.exit()
        print("No")

Submission Info

Submission Time
Task B - Palindrome with leading zeros
User QmanEnobikto
Language Python (3.8.2)
Score 200
Code Size 499 Byte
Status AC
Exec Time 31 ms
Memory 9120 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, random_01.txt, random_02.txt, random_03.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt AC 24 ms 8824 KiB
hand_02.txt AC 21 ms 8936 KiB
hand_03.txt AC 24 ms 8924 KiB
hand_04.txt AC 19 ms 8912 KiB
hand_05.txt AC 19 ms 8828 KiB
hand_06.txt AC 19 ms 8928 KiB
hand_07.txt AC 19 ms 8928 KiB
hand_08.txt AC 18 ms 8920 KiB
hand_09.txt AC 19 ms 8824 KiB
hand_10.txt AC 20 ms 8824 KiB
hand_11.txt AC 18 ms 8820 KiB
hand_12.txt AC 19 ms 8988 KiB
hand_13.txt AC 19 ms 9116 KiB
hand_14.txt AC 26 ms 8824 KiB
hand_15.txt AC 19 ms 9052 KiB
hand_16.txt AC 21 ms 8924 KiB
hand_17.txt AC 19 ms 8928 KiB
hand_18.txt AC 19 ms 8936 KiB
hand_19.txt AC 19 ms 8936 KiB
random_01.txt AC 18 ms 8824 KiB
random_02.txt AC 19 ms 9120 KiB
random_03.txt AC 18 ms 9052 KiB
sample_01.txt AC 19 ms 8828 KiB
sample_02.txt AC 31 ms 9120 KiB
sample_03.txt AC 19 ms 8840 KiB