結果

問題 No.1537 私の代わりに仕事やっといてください。
ユーザー yuruhiyayuruhiya
提出日時 2021-07-16 17:59:58
言語 Crystal
(1.11.2)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 19,229 ms
コンパイル使用メモリ 259,508 KB
実行使用メモリ 19,372 KB
最終ジャッジ日時 2023-09-20 09:17:09
合計ジャッジ時間 20,596 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 2 ms
4,488 KB
testcase_02 AC 74 ms
19,372 KB
testcase_03 AC 2 ms
4,436 KB
testcase_04 AC 2 ms
4,432 KB
testcase_05 AC 3 ms
4,600 KB
testcase_06 AC 3 ms
4,600 KB
testcase_07 AC 3 ms
4,736 KB
testcase_08 AC 3 ms
4,624 KB
testcase_09 AC 4 ms
5,124 KB
testcase_10 AC 9 ms
6,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = read_line.to_i
a = read_line.split.map(&.to_i)
x = 0
b, c = (1..n).to_a.sort_by { |i| a[i - 1] }.group_by { (x += 1) % 2 }.values_at(1, 0)
d = (b + c.reverse) * 2
puts (d[d.index(1).not_nil!, n] + [1]).join(' ')
0