結果

問題 No.2234 palindromer
ユーザー YutaYuta
提出日時 2023-03-14 11:17:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 676 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 9,960 KB
最終ジャッジ日時 2023-10-18 11:33:37
合計ジャッジ時間 1,393 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,960 KB
testcase_01 AC 28 ms
9,960 KB
testcase_02 AC 29 ms
9,960 KB
testcase_03 WA -
testcase_04 AC 28 ms
9,960 KB
testcase_05 AC 28 ms
9,960 KB
testcase_06 AC 28 ms
9,960 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 28 ms
9,960 KB
testcase_13 WA -
testcase_14 AC 28 ms
9,960 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def palindrome(sentence):
    if  sentence[-1] == sentence[-2]:
        sentence2 = sentence[::-1]
        sentence3 = sentence2[2:]
        new_sentence = sentence + sentence3
        print(new_sentence)



    else:
        sentence2 = sentence[::-1]
        sentence3 = sentence2[1:]
        new_sentence = sentence + sentence3
        print(new_sentence)



def check_palindrome(sentence):
    for i in range(len(sentence)):
        if sentence[i] == sentence[-(i + 1)]:
            pass

            
        else:
            palindrome(sentence)
            break
    
    else:
        print(sentence)
        

        
sentence = input("")
check_palindrome(sentence)
0