結果
| 問題 | No.1433 Two color sequence |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-03-19 21:51:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 219 bytes |
| 記録 | |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 108,032 KB |
| 最終ジャッジ日時 | 2026-05-13 08:26:04 |
| 合計ジャッジ時間 | 3,083 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n = int(input())
s = input()
a = map(int, input().split())
now = mn = mx = 0
for c, x in zip(s, a):
if c == 'R':
now += x
else:
now -= x
mx = max(mx, now)
mn = min(mn, now)
print(mx - mn)
Kude