結果
| 問題 |
No.110 しましまピラミッド
|
| コンテスト | |
| ユーザー |
syokeinin
|
| 提出日時 | 2014-12-24 01:38:25 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 591 bytes |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-06-12 04:53:45 |
| 合計ジャッジ時間 | 3,491 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 3 |
| other | AC * 1 RE * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
gets.to_i
w_list = gets.to_s.split(" ").map(&:to_i).sort{|a, b| b <=> a}.uniq.map{|n| ["W", n] }
gets.to_i
b_list = gets.to_s.split(" ").map(&:to_i).sort{|a, b| b <=> a}.uniq.map{|n| ["B", n] }
result_list = (w_list + b_list)
(w_list + b_list).sort{|a, b| b[1] <=> a[1]}.each_cons(2){|n1, n2| result_list.push ["WB",n1[1]] if n1[1] == n2[1]}
result_list.sort!{ |a, b| b[0].length + b[1] <=> a[0].length + a[1] }.uniq!{|n| n[1]}
#p result_list
count = 1
result_list.each_cons(2){count += 1 if !(n1[0].eql? n2[0]) || (n1[0].eql?("WB") && n2[0].eql?("WB"))} if result_list.length != 1
p count
syokeinin