結果

問題 No.110 しましまピラミッド
ユーザー syokeininsyokeinin
提出日時 2014-12-24 01:29:19
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-09-02 22:42:14
合計ジャッジ時間 4,232 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
15,100 KB
testcase_01 AC 87 ms
15,224 KB
testcase_02 AC 86 ms
15,072 KB
testcase_03 AC 88 ms
15,100 KB
testcase_04 AC 87 ms
15,164 KB
testcase_05 AC 87 ms
15,136 KB
testcase_06 AC 84 ms
15,080 KB
testcase_07 AC 87 ms
15,224 KB
testcase_08 AC 89 ms
15,248 KB
testcase_09 WA -
testcase_10 AC 87 ms
15,312 KB
testcase_11 AC 87 ms
15,068 KB
testcase_12 AC 87 ms
15,304 KB
testcase_13 AC 86 ms
15,136 KB
testcase_14 AC 90 ms
15,300 KB
testcase_15 WA -
testcase_16 AC 87 ms
15,272 KB
testcase_17 AC 91 ms
15,144 KB
testcase_18 AC 88 ms
15,280 KB
testcase_19 AC 88 ms
15,148 KB
testcase_20 AC 89 ms
15,088 KB
testcase_21 AC 87 ms
15,088 KB
testcase_22 AC 89 ms
15,164 KB
testcase_23 AC 86 ms
15,132 KB
testcase_24 AC 86 ms
15,180 KB
testcase_25 AC 86 ms
15,248 KB
testcase_26 AC 89 ms
15,328 KB
testcase_27 AC 86 ms
15,104 KB
testcase_28 AC 87 ms
15,024 KB
testcase_29 AC 88 ms
15,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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[1] <=> a[1]}.sort!{|a, b| b[0].length <=> a[0].length }.uniq!{|n| n[1]}
#p result_list
count = 1
result_list.each_cons(2){|n1, n2|count += 1 if !(n1[0].eql? n2[0]) || (n1[0].eql?("WB") && n2[0].eql?("WB"))} if result_list.length != 1 
p count
0