結果

問題 No.1471 Sort Queries
ユーザー 👑 tatt61880tatt61880
提出日時 2021-04-09 21:54:00
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 2,487 ms
コンパイル使用メモリ 150,596 KB
実行使用メモリ 6,076 KB
最終ジャッジ日時 2023-10-14 18:23:42
合計ジャッジ時間 5,533 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,356 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 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,352 KB
testcase_13 AC 7 ms
4,712 KB
testcase_14 AC 7 ms
4,624 KB
testcase_15 AC 10 ms
4,760 KB
testcase_16 AC 7 ms
4,348 KB
testcase_17 AC 6 ms
4,676 KB
testcase_18 AC 5 ms
4,488 KB
testcase_19 AC 6 ms
4,352 KB
testcase_20 AC 9 ms
4,736 KB
testcase_21 AC 6 ms
4,784 KB
testcase_22 AC 5 ms
4,636 KB
testcase_23 AC 12 ms
5,448 KB
testcase_24 AC 11 ms
5,452 KB
testcase_25 AC 17 ms
5,492 KB
testcase_26 AC 13 ms
5,016 KB
testcase_27 AC 14 ms
5,820 KB
testcase_28 AC 14 ms
5,796 KB
testcase_29 AC 12 ms
5,124 KB
testcase_30 AC 12 ms
5,296 KB
testcase_31 AC 17 ms
5,276 KB
testcase_32 AC 18 ms
5,056 KB
testcase_33 AC 19 ms
6,012 KB
testcase_34 AC 21 ms
6,076 KB
testcase_35 AC 20 ms
5,900 KB
testcase_36 AC 19 ms
5,752 KB
testcase_37 AC 19 ms
5,748 KB
testcase_38 AC 18 ms
5,864 KB
testcase_39 AC 19 ms
5,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var q: int :: cui@inputInt()
	var s: []char :: cui@input()
	var cum: [][]int :: #[26, n + 1]int
	for i(1, n)
		for j(0, 25)
			do cum[j][i] :: cum[j][i - 1]
		end for
		do cum[s[i - 1] $ int - 'a' $ int][i] :+ 1
	end for
	
	for(1, q)
		var l: int :: cui@inputInt()
		var r: int :: cui@inputInt()
		var x: int :: cui@inputInt()
		var num: int
		var ans: char
		for i(0, 25)
			do num :: cum[i][r] - cum[i][l - 1]
			do x :- num
			if(x <= 0)
				do ans :: 'a'.offset(i)
				break i
			end if
		end for
		do cui@print("\{ans}\n")
	end for
end func
0