結果
| 問題 |
No.672 最長AB列
|
| コンテスト | |
| ユーザー |
syunsuke
|
| 提出日時 | 2018-06-24 22:57:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 437 bytes |
| コンパイル時間 | 132 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-06-30 22:36:24 |
| 合計ジャッジ時間 | 3,981 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 TLE * 1 -- * 8 |
ソースコード
S=input()
A=S.count("A")
B=S.count("B")
m=[A,B]
#print(min(m))
if min(m)==0:
print(0)
else:
list1=[]
for i in range(min(m)):
for j in range(len(S)-2*min(m)+1+2*i):
if len(S[j:j+2*min(m)-2*i])==2*S[j:j+2*min(m)-2*i].count("A"):
list1.append(len(S[j:j+2*min(m)-2*i]))
i=min(m)
break
else:
j+=1
print(list1[0])
syunsuke