結果
| 問題 |
No.1537 私の代わりに仕事やっといてください。
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2023-02-02 20:09:50 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 724 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 40,576 KB |
| 最終ジャッジ日時 | 2024-07-02 07:10:46 |
| 合計ジャッジ時間 | 4,547 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i
A = gets.split.map(&:to_i)
nums = []
A.each.with_index(1) do |a, i|
nums << [a, i]
end
nums.sort_by! { |a, _| a }
ans = []
nums.each.with_index do |(a, i), idx|
if idx.even?
ans.push(i)
else
ans.unshift(i)
end
end
while ans[0] != 1
ans.rotate!
end
ans << 1
puts ans.join(' ')
siman