結果
| 問題 |
No.1433 Two color sequence
|
| コンテスト | |
| ユーザー |
lie_of_lillie
|
| 提出日時 | 2021-06-14 00:37:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 213 ms / 2,000 ms |
| コード長 | 201 bytes |
| コンパイル時間 | 580 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 33,316 KB |
| 最終ジャッジ日時 | 2024-12-23 16:01:38 |
| 合計ジャッジ時間 | 6,647 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import collections
N=int(input())
S=input()
*A,=map(int,input().split())
cs = [0]
for i in range(N):
if S[i] == "B":
A[i] = -A[i]
cs.append(cs[-1] + A[i])
print(abs(max(cs) - min(cs)))
lie_of_lillie