結果

問題 No.90 品物の並び替え
ユーザー simansiman
提出日時 2015-11-05 11:15:19
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 139 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,268 KB
実行使用メモリ 21,848 KB
最終ジャッジ日時 2023-10-11 13:52:38
合計ジャッジ時間 9,471 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,020 KB
testcase_01 AC 666 ms
15,672 KB
testcase_02 AC 78 ms
15,196 KB
testcase_03 AC 115 ms
15,156 KB
testcase_04 AC 139 ms
15,348 KB
testcase_05 AC 764 ms
15,668 KB
testcase_06 AC 537 ms
15,572 KB
testcase_07 AC 84 ms
15,344 KB
testcase_08 AC 78 ms
15,220 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets
l=$<.map{|s|s.split.map &:to_i}
p [*(0..n.to_i-1)].permutation.map{|a|l.inject(0){|s,e|x,y,v=*e;s+=(a.index(x)<a.index(y))?v:0}}.max
0