結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,236 KB
testcase_01 AC 563 ms
15,572 KB
testcase_02 AC 78 ms
15,128 KB
testcase_03 AC 109 ms
15,120 KB
testcase_04 AC 127 ms
15,260 KB
testcase_05 AC 624 ms
15,500 KB
testcase_06 AC 458 ms
15,764 KB
testcase_07 AC 85 ms
15,200 KB
testcase_08 AC 78 ms
15,160 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;h[x]<h[y]&&s+=v};s
}.max
0