結果

問題 No.130 XOR Minimax
ユーザー syarosyaro
提出日時 2016-02-22 21:58:54
言語 Ruby
(3.2.2)
結果
AC  
実行時間 1,080 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 41,072 KB
最終ジャッジ日時 2023-10-10 00:13:42
合計ジャッジ時間 14,167 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 520 ms
21,324 KB
testcase_01 AC 82 ms
15,120 KB
testcase_02 AC 82 ms
15,120 KB
testcase_03 AC 83 ms
15,288 KB
testcase_04 AC 450 ms
35,436 KB
testcase_05 AC 464 ms
36,432 KB
testcase_06 AC 809 ms
33,892 KB
testcase_07 AC 799 ms
41,072 KB
testcase_08 AC 1,080 ms
30,304 KB
testcase_09 AC 199 ms
18,580 KB
testcase_10 AC 267 ms
20,108 KB
testcase_11 AC 714 ms
33,376 KB
testcase_12 AC 137 ms
16,676 KB
testcase_13 AC 592 ms
31,400 KB
testcase_14 AC 990 ms
24,084 KB
testcase_15 AC 93 ms
15,312 KB
testcase_16 AC 691 ms
23,256 KB
testcase_17 AC 722 ms
23,676 KB
testcase_18 AC 774 ms
24,440 KB
testcase_19 AC 923 ms
23,460 KB
testcase_20 AC 477 ms
20,668 KB
testcase_21 AC 971 ms
23,860 KB
testcase_22 AC 261 ms
16,772 KB
testcase_23 AC 134 ms
15,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

f=->(d,v){
return 0 if d<0

if v.map{|x|x[d]}.uniq[1]
  2**d+[f[d-1,v.select{|x|x[d]>0}],f[d-1,v.select{|x|x[d]<1}]].min
else
  f[d-1,v]
end
}
gets
p f[30,gets.split.map(&:to_i)]
0