結果

問題 No.519 アイドルユニット
ユーザー letrangerjpletrangerjp
提出日時 2017-06-01 20:19:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 517 ms / 1,000 ms
コード長 140 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 18,432 KB
最終ジャッジ日時 2024-04-14 06:42:23
合計ジャッジ時間 8,304 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 510 ms
18,176 KB
testcase_01 AC 503 ms
18,176 KB
testcase_02 AC 232 ms
13,696 KB
testcase_03 AC 106 ms
12,544 KB
testcase_04 AC 86 ms
12,288 KB
testcase_05 AC 85 ms
12,416 KB
testcase_06 AC 86 ms
12,160 KB
testcase_07 AC 86 ms
12,160 KB
testcase_08 AC 88 ms
12,160 KB
testcase_09 AC 89 ms
12,160 KB
testcase_10 AC 95 ms
12,288 KB
testcase_11 AC 110 ms
12,800 KB
testcase_12 AC 86 ms
12,288 KB
testcase_13 AC 106 ms
12,544 KB
testcase_14 AC 107 ms
12,544 KB
testcase_15 AC 107 ms
12,544 KB
testcase_16 AC 106 ms
12,544 KB
testcase_17 AC 107 ms
12,544 KB
testcase_18 AC 107 ms
12,800 KB
testcase_19 AC 106 ms
12,672 KB
testcase_20 AC 110 ms
12,544 KB
testcase_21 AC 112 ms
12,544 KB
testcase_22 AC 112 ms
12,544 KB
testcase_23 AC 106 ms
12,544 KB
testcase_24 AC 140 ms
12,928 KB
testcase_25 AC 140 ms
12,928 KB
testcase_26 AC 138 ms
12,928 KB
testcase_27 AC 140 ms
13,184 KB
testcase_28 AC 143 ms
13,056 KB
testcase_29 AC 509 ms
18,176 KB
testcase_30 AC 517 ms
18,176 KB
testcase_31 AC 507 ms
18,304 KB
testcase_32 AC 505 ms
18,432 KB
testcase_33 AC 84 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N,*T=$<.map{|s|s.split.map &:to_i}
d={}
g=->u{d[u]||=(0...a=u.bit_length-1).map{|b|u[b]>0?T[a][b]+g[1<<b|1<<a^u]:0}.max||0}
p g[~(-1<<N[0])]
0