結果
問題 |
No.672 最長AB列
|
ユーザー |
![]() |
提出日時 | 2018-06-24 22:54:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 363 bytes |
コンパイル時間 | 104 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 18,204 KB |
最終ジャッジ日時 | 2024-06-30 22:36:13 |
合計ジャッジ時間 | 4,354 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 2 WA * 5 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: 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"): print(len(S[j:j+2*min(m)-2*i])) break else: j+=1