結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,084 KB
testcase_01 AC 80 ms
15,232 KB
testcase_02 AC 229 ms
15,168 KB
testcase_03 AC 73 ms
14,980 KB
testcase_04 AC 74 ms
15,112 KB
testcase_05 AC 77 ms
15,080 KB
testcase_06 AC 128 ms
15,160 KB
testcase_07 AC 151 ms
15,388 KB
testcase_08 AC 101 ms
15,352 KB
testcase_09 AC 106 ms
15,200 KB
testcase_10 AC 450 ms
15,204 KB
testcase_11 AC 106 ms
15,404 KB
testcase_12 AC 100 ms
15,168 KB
testcase_13 AC 104 ms
15,156 KB
testcase_14 AC 139 ms
15,152 KB
testcase_15 AC 143 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,*a=$<.read.split.map &:to_i
f=->u{[*0...n].combination(3).find{|i,j,k|v=1<<i|1<<j|1<<k;(a[i]-a[j])*(a[j]-a[k])<0&&(u&v)==0&&!f[u|v]}}
$><<(f[0]||[-1])*' '
0