結果
| 問題 | No.1433 Two color sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-19 22:26:36 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 68 ms / 2,000 ms |
| + 688µs | |
| コード長 | 248 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 123,936 KB |
| 最終ジャッジ日時 | 2026-09-26 02:37:39 |
| 合計ジャッジ時間 | 4,515 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
N = int(input())
S = input()
A = list(map(int, input().split()))
for i in range(N):
if S[i]=='B':
A[i] *= -1
from itertools import groupby, accumulate, product, permutations, combinations
cum = [0]+list(accumulate(A))
print(max(cum)-min(cum))