結果

問題 No.90 品物の並び替え
ユーザー simansiman
提出日時 2015-11-05 13:20:59
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 145 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 22,236 KB
最終ジャッジ日時 2023-10-11 13:56:20
合計ジャッジ時間 9,190 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,300 KB
testcase_01 AC 562 ms
15,504 KB
testcase_02 AC 77 ms
15,124 KB
testcase_03 AC 110 ms
15,264 KB
testcase_04 AC 129 ms
15,196 KB
testcase_05 AC 631 ms
15,720 KB
testcase_06 AC 470 ms
15,616 KB
testcase_07 AC 84 ms
15,184 KB
testcase_08 AC 78 ms
15,064 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
s=0;l.map{|e|x,y,v=*e;s+=h[x]<h[y]?v:0};s
}.max
0