結果
| 問題 |
No.1537 私の代わりに仕事やっといてください。
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-04-19 12:16:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 626 ms / 2,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 82,688 KB |
| 実行使用メモリ | 117,920 KB |
| 最終ジャッジ日時 | 2024-10-14 12:13:20 |
| 合計ジャッジ時間 | 2,787 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
ソースコード
from collections import *
N = int(input())
A = list(map(int, input().split()))
D = deque()
B = []
for i in range(N):
B.append((A[i], i + 1))
B.sort(reverse=True)
for i in range(N):
if i % 2:
D.append(B[i][1])
else:
D.appendleft(B[i][1])
D = list(D)
ind = D.index(1)
ans = D[ind:] + D[:ind] + [1]
print(*ans)
rlangevin