結果

問題 No.935 う し た ぷ に き あ く ん 笑 ビ - ム
ユーザー 👑 tatt61880tatt61880
提出日時 2020-05-13 02:00:33
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 149,960 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-14 16:52:26
合計ジャッジ時間 8,470 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 AC 1 ms
4,348 KB
testcase_13 RE -
testcase_14 WA -
testcase_15 AC 2 ms
4,348 KB
testcase_16 RE -
testcase_17 AC 6 ms
4,348 KB
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 WA -
testcase_25 WA -
testcase_26 RE -
testcase_27 WA -
testcase_28 WA -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 WA -
testcase_35 WA -
testcase_36 RE -
testcase_37 WA -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 RE -
testcase_47 WA -
testcase_48 WA -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 WA -
testcase_54 RE -
testcase_55 WA -
testcase_56 RE -
testcase_57 RE -
testcase_58 AC 2 ms
4,348 KB
testcase_59 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var s: []char :: cui@input()
	var num: int :: 0
	for i(0, n - 1)
		do num :+ s[i] = 'E' ?(1, 0)
	end for
	var a: []int :: #[num]int
	var idx: int :: 0
	for i(0, n - 1)
		do a[idx] :: cui@inputInt()
		if(s[i] = 'E')
			do idx :+ 1
		end if
	end for
	var cum: []int :: #[num + 1]int
	do cum[0] :: 0
	for i(1, num)
		do cum[i] :: cum[i - 1] + a[i - 1]
	end for
	
	var q: int :: cui@inputInt()
	for(1, q)
		var k: int :: cui@inputInt()
		var ok: int :: 0
		var ng: int :: num + 1
		while((ok - ng).abs() > 1)
			var md: int :: (ok + ng) / 2
			if(cum[md] <= k)
				do ok :: md
			else
				do ng :: md
			end if
		end while
		var ans: int :: ok
		do cui@print("\{ans}\n")
	end for
end func
0