結果

問題 No.1433 Two color sequence
ユーザー Akijin_007Akijin_007
提出日時 2023-05-11 18:49:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 106,540 KB
最終ジャッジ日時 2023-08-18 11:11:23
合計ジャッジ時間 6,180 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,016 KB
testcase_01 AC 64 ms
71,032 KB
testcase_02 AC 66 ms
71,120 KB
testcase_03 AC 117 ms
106,356 KB
testcase_04 AC 101 ms
106,540 KB
testcase_05 AC 65 ms
71,236 KB
testcase_06 AC 67 ms
71,236 KB
testcase_07 AC 66 ms
71,060 KB
testcase_08 AC 119 ms
104,268 KB
testcase_09 AC 124 ms
103,296 KB
testcase_10 AC 123 ms
101,116 KB
testcase_11 AC 124 ms
101,456 KB
testcase_12 AC 124 ms
103,316 KB
testcase_13 AC 124 ms
103,332 KB
testcase_14 AC 121 ms
103,724 KB
testcase_15 AC 120 ms
103,744 KB
testcase_16 AC 122 ms
103,284 KB
testcase_17 AC 126 ms
103,900 KB
testcase_18 AC 121 ms
103,352 KB
testcase_19 AC 127 ms
103,832 KB
testcase_20 AC 121 ms
103,400 KB
testcase_21 AC 125 ms
103,744 KB
testcase_22 AC 122 ms
103,656 KB
testcase_23 AC 122 ms
103,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
S = input()
a = list(map(int, input().split()))

s = [0] * (N+1)
for i in range(N):
    if S[i] == "R":
        s[i+1] = s[i] + a[i]
    else:
        s[i+1] = s[i] - a[i]

print(max(s)-min(s))
0