結果
| 問題 |
No.672 最長AB列
|
| コンテスト | |
| ユーザー |
Subaru314
|
| 提出日時 | 2021-03-11 19:36:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 226 bytes |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 17,956 KB |
| 最終ジャッジ日時 | 2024-10-13 07:20:31 |
| 合計ジャッジ時間 | 4,436 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 TLE * 1 -- * 9 |
ソースコード
str = input()
ans = 0
for i in range(len(str)//2):
s = (i+1)*2
for j in range(len(str)-s+1):
if str[j:j+s].count('A')==str[j:j+s].count('B'):
ans = s
break
else:
continue
break
print(ans)
Subaru314