結果
問題 |
No.1433 Two color sequence
|
ユーザー |
|
提出日時 | 2021-05-19 12:39:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 223 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 21,224 KB |
最終ジャッジ日時 | 2024-10-09 16:51:04 |
合計ジャッジ時間 | 4,616 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 20 |
ソースコード
N = int(input()) S = input() A = list(map(int, input().split())) res = 0 for i in range(N): s = 0 for j in range(i, N): s += A[j] if S[j] == 'R' else -A[j] res = max(res, abs(s)) print(res)