結果
問題 | No.267 トランプソート |
ユーザー |
|
提出日時 | 2016-01-07 05:44:12 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 84 ms / 1,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 56 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-19 12:27:15 |
合計ジャッジ時間 | 2,608 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
Syntax OK
ソースコード
class Cardattr_reader :suit, :numdef initialize(str)@str = str@suit = case str[0]when "D" then 1when "C" then 2when "H" then 3when "S" then 4end@num = case str[1]when "A" then 1when "T" then 10when "J" then 11when "Q" then 12when "K" then 13else str[1].to_iendenddef <=>(other)[suit, num] <=> [other.suit, other.num]enddef to_s@strendendgetsputs gets.split.map{|s| Card.new(s)}.sort.join(" ")