結果

問題 No.90 品物の並び替え
ユーザー simansiman
提出日時 2015-11-05 17:48:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 4,289 ms / 5,000 ms
コード長 174 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,452 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-27 05:42:54
合計ジャッジ時間 6,759 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,232 KB
testcase_01 AC 287 ms
15,228 KB
testcase_02 AC 86 ms
15,152 KB
testcase_03 AC 99 ms
15,336 KB
testcase_04 AC 118 ms
15,340 KB
testcase_05 AC 388 ms
15,228 KB
testcase_06 AC 231 ms
15,236 KB
testcase_07 AC 86 ms
15,256 KB
testcase_08 AC 83 ms
15,084 KB
testcase_09 AC 4,289 ms
15,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
m=t=0
l=$<.map{|s|s.split.map &:to_i}.sort_by{|e|t+=v=e[2];-v}
[*0...$_.to_i].permutation.each{|a|s=t;l.all?{|e|x,y,v=*e;a.index(y)<a.index(x)&&s-=v;s>m};m<s&&(m=s)}
p m
0