結果

問題 No.564 背の順
ユーザー 👑 tatt61880tatt61880
提出日時 2020-07-01 12:32:22
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 2,421 ms
コンパイル使用メモリ 153,844 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 16:56:39
合計ジャッジ時間 3,067 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var h: int :: cui@inputInt()
	var n: int :: cui@inputInt()
	var a: []int :: #[n]int
	do a[0] :: h
	for i(1, n - 1)
		do a[i] :: cui@inputInt()
	end for
	do a.sort()
	do a.reverse()
	
	var ans: int :: 1 + a.find(h, -1)
	var s: []char :: "th"
	switch(ans % 10)
	case 1
		do s :: "st"
	case 2
		do s :: "nd"
	case 3
		do s :: "rd"
	end switch
	do cui@print("\{ans}\{s}\n")
end func
0