結果
| 問題 |
No.519 アイドルユニット
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-01 18:51:24 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 349 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 38,400 KB |
| 最終ジャッジ日時 | 2024-09-21 21:40:41 |
| 合計ジャッジ時間 | 4,503 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 33 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i
$chemistory = {}
N.times.each{|y|
gets.split.take(N).map(&:to_i).each_with_index{|v, x|
$chemistory[[x,y]] = v
}
}
$dp={}
def g(unused)
$dp[unused] ||= if unused.empty?
0
else
a = unused.first
(unused - [a]).inject(0){|r,b|
[r, $chemistory[[a,b]] + g(unused - [a, b])].max
}
end
end
p g([*0...N])