結果

問題 No.334 門松ゲーム
ユーザー angel_p_57angel_p_57
提出日時 2016-01-16 00:28:13
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 235 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 16,212 KB
最終ジャッジ日時 2023-10-19 23:49:54
合計ジャッジ時間 2,508 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
16,076 KB
testcase_01 AC 96 ms
16,076 KB
testcase_02 AC 99 ms
16,200 KB
testcase_03 AC 88 ms
16,076 KB
testcase_04 AC 89 ms
16,076 KB
testcase_05 AC 98 ms
16,076 KB
testcase_06 AC 94 ms
16,212 KB
testcase_07 AC 97 ms
16,208 KB
testcase_08 AC 95 ms
16,212 KB
testcase_09 AC 92 ms
16,076 KB
testcase_10 AC 103 ms
16,192 KB
testcase_11 AC 92 ms
16,192 KB
testcase_12 WA -
testcase_13 AC 102 ms
16,196 KB
testcase_14 AC 93 ms
16,180 KB
testcase_15 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,*k=$<.read.split.map &:to_i
w=->a,f{(0..a.size-1).to_a.combination(3).send(f>0?:select: :any?){|r|i,j,k=r;a[i]!=a[k]&&(a[i]<=>a[j])*(a[j]<=>a[k])<0&&(b=a.dup;[k,j,i].map{|e|b.delete_at(e)};!w[b,0])}}
puts w[k,1].map{|r|r*" "}.min||-1
0