結果

問題 No.334 門松ゲーム
ユーザー cielciel
提出日時 2016-01-16 15:23:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,220 KB
実行使用メモリ 15,376 KB
最終ジャッジ日時 2023-08-27 01:30:01
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,080 KB
testcase_01 AC 83 ms
14,952 KB
testcase_02 AC 86 ms
15,200 KB
testcase_03 AC 78 ms
15,184 KB
testcase_04 AC 76 ms
14,976 KB
testcase_05 AC 77 ms
15,088 KB
testcase_06 AC 88 ms
15,196 KB
testcase_07 AC 84 ms
15,372 KB
testcase_08 AC 82 ms
15,120 KB
testcase_09 AC 79 ms
15,056 KB
testcase_10 AC 96 ms
15,376 KB
testcase_11 AC 81 ms
15,216 KB
testcase_12 AC 183 ms
15,148 KB
testcase_13 AC 98 ms
15,244 KB
testcase_14 AC 83 ms
15,100 KB
testcase_15 AC 160 ms
15,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

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