結果
| 問題 | No.1433 Two color sequence |
| コンテスト | |
| ユーザー |
sepa38
|
| 提出日時 | 2022-12-15 13:36:47 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 81 ms / 2,000 ms |
| + 161µs | |
| コード長 | 201 bytes |
| 記録 | |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 64,692 KB |
| 実行使用メモリ | 90,752 KB |
| 最終ジャッジ日時 | 2026-10-29 02:10:31 |
| 合計ジャッジ時間 | 3,957 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
n = int(input())
s = input()
a = list(map(int, input().split()))
ls = [0]
for i in range(n):
ls.append(ls[-1])
if s[i] == "R":
ls[-1] += a[i]
else:
ls[-1] -= a[i]
print(max(ls) - min(ls))
sepa38