結果

問題 No.1433 Two color sequence
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-19 21:56:31
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 151,480 KB
実行使用メモリ 7,212 KB
最終ジャッジ日時 2023-10-14 17:41:55
合計ジャッジ時間 6,996 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 65 ms
6,948 KB
testcase_04 AC 64 ms
6,992 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 115 ms
7,112 KB
testcase_09 AC 116 ms
7,024 KB
testcase_10 AC 112 ms
7,084 KB
testcase_11 AC 112 ms
7,052 KB
testcase_12 AC 115 ms
7,104 KB
testcase_13 AC 115 ms
7,072 KB
testcase_14 AC 116 ms
7,192 KB
testcase_15 AC 117 ms
6,992 KB
testcase_16 AC 116 ms
7,028 KB
testcase_17 AC 117 ms
7,088 KB
testcase_18 AC 117 ms
7,120 KB
testcase_19 AC 115 ms
6,988 KB
testcase_20 AC 115 ms
7,192 KB
testcase_21 AC 116 ms
7,084 KB
testcase_22 AC 116 ms
7,212 KB
testcase_23 AC 116 ms
7,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var s: []char :: cui@input()
	var a: []int :: #[n]int
	var cum: []int :: #[n + 1]int
	for i(0, n - 1)
		do a[i] :: cui@inputInt() * (s[i] = 'R' ?(1, -1))
		do cum[i + 1] :: cum[i] + a[i]
	end for
	
	var ans: int :: cum.max() - cum.min()
	do cui@print("\{ans}\n")
end func
0