結果

問題 No.273 回文分解
ユーザー McGregorshMcGregorsh
提出日時 2023-05-14 23:51:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 1,500 ms
コンパイル使用メモリ 86,500 KB
実行使用メモリ 76,332 KB
最終ジャッジ日時 2023-08-20 08:42:04
合計ジャッジ時間 6,135 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,272 KB
testcase_01 AC 86 ms
71,396 KB
testcase_02 AC 87 ms
71,068 KB
testcase_03 AC 86 ms
71,436 KB
testcase_04 AC 85 ms
71,212 KB
testcase_05 AC 85 ms
71,320 KB
testcase_06 AC 82 ms
71,448 KB
testcase_07 AC 85 ms
71,448 KB
testcase_08 AC 86 ms
71,128 KB
testcase_09 AC 83 ms
71,072 KB
testcase_10 AC 86 ms
71,276 KB
testcase_11 AC 89 ms
71,280 KB
testcase_12 AC 85 ms
71,068 KB
testcase_13 AC 85 ms
71,480 KB
testcase_14 AC 91 ms
76,332 KB
testcase_15 AC 85 ms
71,124 KB
testcase_16 AC 83 ms
71,332 KB
testcase_17 AC 84 ms
71,236 KB
testcase_18 AC 83 ms
71,480 KB
testcase_19 AC 87 ms
70,940 KB
testcase_20 AC 85 ms
71,336 KB
testcase_21 AC 84 ms
71,376 KB
testcase_22 AC 89 ms
75,408 KB
testcase_23 AC 87 ms
75,456 KB
testcase_24 AC 89 ms
75,480 KB
testcase_25 AC 90 ms
75,520 KB
testcase_26 AC 87 ms
75,524 KB
testcase_27 AC 90 ms
75,520 KB
testcase_28 AC 95 ms
75,840 KB
testcase_29 AC 83 ms
71,288 KB
testcase_30 AC 86 ms
75,508 KB
testcase_31 AC 84 ms
71,464 KB
testcase_32 AC 82 ms
71,316 KB
testcase_33 AC 83 ms
71,436 KB
testcase_34 AC 84 ms
71,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
   
   S = input()
   lenS = len(S)
   
   ans = 0
   for i in range(lenS-1):
   	  for j in range(i, lenS):
   	  	  p = S[i:j+1]
   	  	  if p == p[::-1]:
   	  	  	  if j - i + 1 == lenS:
   	  	  	  	  continue
   	  	  	  ans = max(ans, j - i + 1)
   	  	  	  
   print(ans)
   
if __name__ == '__main__':
    main()
    
0