結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,108 KB
testcase_01 AC 602 ms
15,432 KB
testcase_02 AC 82 ms
15,060 KB
testcase_03 AC 116 ms
15,376 KB
testcase_04 AC 136 ms
15,228 KB
testcase_05 AC 666 ms
15,752 KB
testcase_06 AC 500 ms
15,408 KB
testcase_07 AC 87 ms
15,240 KB
testcase_08 AC 79 ms
15,272 KB
testcase_09 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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