結果

問題 No.90 品物の並び替え
ユーザー letrangerjpletrangerjp
提出日時 2017-10-22 12:32:20
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 141 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 22,016 KB
最終ジャッジ日時 2024-05-01 10:14:35
合計ジャッジ時間 9,246 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
12,160 KB
testcase_01 AC 694 ms
13,312 KB
testcase_02 AC 75 ms
12,288 KB
testcase_03 AC 138 ms
13,056 KB
testcase_04 AC 140 ms
13,056 KB
testcase_05 AC 673 ms
13,312 KB
testcase_06 AC 673 ms
13,184 KB
testcase_07 AC 84 ms
12,544 KB
testcase_08 AC 73 ms
12,160 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.hex
t={}
$<.map{|s|eval"t[0d%d%d]=%d"%s.split}
p (R=*0...N).permutation.map{|a|R.product(R).map{|i,j|i<j&&t[a[i]*10+a[j]]||0}.sum}.max
0