結果

問題 No.267 トランプソート
ユーザー horiesiniti
提出日時 2018-03-16 08:46:28
言語 Ruby
(3.4.1)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 282 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-12-21 14:10:21
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(x)
	res=x.map{|e|
		["A23456789TJQK".index(e[1]),e]
	}
	return res.sort.map{|e|
		e[1]
	}
end
gets
x=gets.chomp.split
d=[]
c=[]
h=[]
s=[]
x.each{|e|
	case e[0]
	when "D"
		d<<e
	when "C"
		c<<e
	when "H"
		h<<e
	when "S"
		s<<e
	end
}
puts (f(d)<<f(c)<<f(h)<<f(s)).flatten*" "
0