結果
問題 | No.588 空白と回文 |
ユーザー | KoshStorm |
提出日時 | 2017-11-04 00:00:22 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 16,128 KB |
最終ジャッジ日時 | 2024-05-02 20:52:06 |
合計ジャッジ時間 | 4,302 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
16,000 KB |
testcase_01 | AC | 30 ms
10,496 KB |
testcase_02 | AC | 30 ms
10,624 KB |
testcase_03 | AC | 30 ms
10,624 KB |
testcase_04 | AC | 29 ms
10,624 KB |
testcase_05 | WA | - |
testcase_06 | AC | 31 ms
10,624 KB |
testcase_07 | AC | 30 ms
10,624 KB |
testcase_08 | AC | 29 ms
10,624 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 30 ms
10,624 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
ソースコード
S = list(input()) l = len(S) -1 def solve(i,j): global S count = 0 while i <= j: #print("i:",i,"j:",j) if S[i] == S[j]: if i == j: count += 1 else: count += 2 i += 1 j -= 1 return count prev_count = 0 for i in range(l-1): for j in range(i+1): if prev_count >= l - i: print(prev_count) exit(0) count = solve(i+j,l-j) #print("count:",count) if prev_count < count: prev_count = count print(1)