結果

問題 No.1110 好きな歌
ユーザー 👑 tatt61880tatt61880
提出日時 2020-07-10 21:39:54
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 461 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 155,892 KB
実行使用メモリ 16,184 KB
最終ジャッジ日時 2023-10-14 16:58:38
合計ジャッジ時間 19,270 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,356 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,368 KB
testcase_14 AC 3 ms
4,352 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 3 ms
4,372 KB
testcase_17 AC 3 ms
4,368 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 3 ms
4,352 KB
testcase_20 AC 3 ms
4,352 KB
testcase_21 AC 3 ms
4,348 KB
testcase_22 AC 3 ms
4,352 KB
testcase_23 AC 2 ms
4,356 KB
testcase_24 AC 261 ms
10,856 KB
testcase_25 AC 316 ms
12,472 KB
testcase_26 AC 156 ms
8,292 KB
testcase_27 AC 311 ms
12,348 KB
testcase_28 AC 173 ms
8,688 KB
testcase_29 AC 372 ms
13,664 KB
testcase_30 AC 174 ms
8,756 KB
testcase_31 AC 101 ms
6,616 KB
testcase_32 AC 419 ms
15,100 KB
testcase_33 AC 199 ms
9,548 KB
testcase_34 AC 282 ms
11,660 KB
testcase_35 AC 440 ms
16,044 KB
testcase_36 AC 42 ms
5,140 KB
testcase_37 AC 114 ms
6,784 KB
testcase_38 AC 368 ms
13,704 KB
testcase_39 AC 268 ms
11,112 KB
testcase_40 AC 349 ms
13,360 KB
testcase_41 AC 23 ms
4,752 KB
testcase_42 AC 400 ms
14,832 KB
testcase_43 AC 367 ms
13,568 KB
testcase_44 AC 447 ms
16,116 KB
testcase_45 AC 455 ms
16,184 KB
testcase_46 AC 455 ms
15,968 KB
testcase_47 AC 460 ms
15,956 KB
testcase_48 AC 461 ms
16,116 KB
testcase_49 AC 443 ms
16,152 KB
testcase_50 AC 450 ms
15,996 KB
testcase_51 AC 449 ms
15,936 KB
testcase_52 AC 448 ms
16,156 KB
testcase_53 AC 460 ms
16,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var d: int :: cui@inputInt()
	var a: []int :: #[n]int
	for i(0, n - 1)
		do a[i] :: cui@inputInt()
	end for
	var b: []int :: ##a
	do b.sort()
	
	var r: int :: 0
	var mp: dict<int, int> :: #dict<int, int>
	for i(0, n - 1)
		while(r <> i & b[r] + d <= b[i])
			do r :+ 1
		end while
		var ans: int :: r
		do mp.add(b[i], ans)
	end for
	
	for i(0, n - 1)
		do cui@print("\{mp.get(a[i], &)}\n")
	end for
end func
0