結果
| 問題 | No.1433 Two color sequence |
| コンテスト | |
| ユーザー |
👑 terry_u16
|
| 提出日時 | 2021-03-19 22:15:20 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 90 ms / 2,000 ms |
| + 737µs | |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 64,368 KB |
| 実行使用メモリ | 89,516 KB |
| 最終ジャッジ日時 | 2026-10-29 01:26:56 |
| 合計ジャッジ時間 | 4,724 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
n = int(input())
s = input()
a = list(map(int, input().split()))
max_score = 0
for sign_r in range(-1, 2, 2):
sign_b = -sign_r
score = 0
for i in range(0, n):
if s[i] == 'R':
score += sign_r * a[i]
else:
score += sign_b * a[i]
max_score = max(max_score, score)
if score < 0:
score = 0
print(max_score)
terry_u16