結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
k_ab_o
|
| 提出日時 | 2017-01-25 14:55:57 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 515 bytes |
| コンパイル時間 | 52 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 20,224 KB |
| 最終ジャッジ日時 | 2024-12-23 08:24:31 |
| 合計ジャッジ時間 | 6,943 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
class Xxx
attr_accessor :answer
def initialize
end
def set_inputs
@n = gets.chomp.to_i
@block_lens = gets.chomp.split(" ").map{|n| n.to_i}
end
def execute
@sorting = []
@prev = nil
@block_lens.each do |n|
if @prev.nil?
@prev = n
next
end
if @prev > n
@sorting << n
else
@prev = n
end
end
@answer = @sorting.size
end
end
if $0 == __FILE__
ins = Xxx.new
ins.set_inputs
ins.execute
puts ins.answer
end
k_ab_o