結果
問題 | No.1537 私の代わりに仕事やっといてください。 |
ユーザー | 小野寺健 |
提出日時 | 2021-11-15 09:08:38 |
言語 | Ruby (3.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 602 ms |
コンパイル使用メモリ | 11,264 KB |
実行使用メモリ | 814,252 KB |
最終ジャッジ日時 | 2023-08-20 22:43:26 |
合計ジャッジ時間 | 6,058 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 81 ms
15,328 KB |
testcase_01 | AC | 82 ms
15,284 KB |
testcase_02 | MLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i A = gets.split(" ").map{|s| s.to_i} d = Array.new(N) {Array.new(N, 0)} 0.upto(N-1) {|i| 0.upto(N-1) {|j| d[i][j] = A[i] * A[j] if i != j } } notvisit = 1.upto(N-1).to_a visited = "1" i = 0 while notvisit.length > 0 do max = 0 max_i = nil notvisit.each {|j| dj = d[i][j] if dj > max then max = dj max_i = j end } i = max_i visited << " #{i+1}" notvisit.delete(i) end visited << " 1" puts visited