結果
| 問題 |
No.571 3人兄弟(その2)
|
| コンテスト | |
| ユーザー |
toshiro_yanagi
|
| 提出日時 | 2025-04-29 23:26:54 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 552 bytes |
| コンパイル時間 | 251 ms |
| コンパイル使用メモリ | 8,224 KB |
| 実行使用メモリ | 13,184 KB |
| 最終ジャッジ日時 | 2025-04-29 23:26:57 |
| 合計ジャッジ時間 | 2,516 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 4 WA * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
class Main
Brother = Struct.new(:i, :h, :w)
def start
brothers = main
brothers.sort_by! { |x| x.w }
brothers.sort_by!.with_index { |x, i| x.h }.reverse!
echo brothers.map { |x| x.i }.join("\n")
self.class.send(:remove_const, :Brother)
return nil
end
private
def main
a = []
for i in 0...3
h, w = input.split
brother = Brother.new(("A".ord + i).chr, h, w)
a += [brother]
end
return a
end
def echo(*x)
print(*x)
puts
end
def input = gets.chomp
end
Main.new.start
toshiro_yanagi