結果

問題 No.1433 Two color sequence
ユーザー shacklebolt-codeshacklebolt-code
提出日時 2021-03-19 22:52:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 31,548 KB
最終ジャッジ日時 2023-08-12 03:44:28
合計ジャッジ時間 4,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,760 KB
testcase_02 AC 16 ms
7,756 KB
testcase_03 AC 130 ms
13,252 KB
testcase_04 AC 129 ms
13,172 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 16 ms
7,788 KB
testcase_07 AC 16 ms
7,864 KB
testcase_08 AC 167 ms
31,336 KB
testcase_09 AC 172 ms
31,240 KB
testcase_10 AC 171 ms
30,392 KB
testcase_11 AC 167 ms
30,696 KB
testcase_12 AC 168 ms
31,348 KB
testcase_13 AC 171 ms
31,424 KB
testcase_14 AC 174 ms
31,328 KB
testcase_15 AC 174 ms
31,396 KB
testcase_16 AC 171 ms
31,396 KB
testcase_17 AC 171 ms
31,396 KB
testcase_18 AC 171 ms
31,464 KB
testcase_19 AC 172 ms
31,452 KB
testcase_20 AC 172 ms
31,516 KB
testcase_21 AC 171 ms
31,480 KB
testcase_22 AC 174 ms
31,548 KB
testcase_23 AC 176 ms
31,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
L = [0]
A = list(map(int, input().split()))
for i in range(N):
    if S[i] == 'R':
        L += [L[-1] + A[i]]
    else:
        L += [L[-1] - A[i]]
print(max(L) - min(L))
0