結果
| 問題 | No.1537 私の代わりに仕事やっといてください。 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-15 09:30:44 |
| 言語 | Ruby (4.0.6 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 247 ms / 2,000 ms |
| + 915µs | |
| コード長 | 278 bytes |
| 記録 | |
| コンパイル時間 | 9 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 52,844 KB |
| 最終ジャッジ日時 | 2026-10-03 07:08:24 |
| 合計ジャッジ時間 | 2,334 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i
A = gets.split(" ").map.with_index{|s, i| [s.to_i, i+1]}
top = true
ans = []
A.sort_by{|x, i| -x}.each {|x, i|
if top then
ans.unshift(i.to_s)
else
ans.push(i.to_s)
end
top = !top
}
i = ans.index("1")
puts (ans[i, N-i] + ans[0, i] + ["1"]).join(" ")