結果
| 問題 |
No.559 swapAB列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-20 23:53:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 237 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-11-08 09:21:45 |
| 合計ジャッジ時間 | 1,215 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
import re
P = re.compile('B')
def f(s):
t = len(s) - 1
if t == 0:
return 0
l = [t - m.start() for m in P.finditer(s)]
t = len(l) - 1
return sum(i-j for i,j in zip(l, range(t,-1,-1)))
s = input()
print(f(s))