結果

問題 No.1537 私の代わりに仕事やっといてください。
ユーザー H3PO4H3PO4
提出日時 2023-02-26 20:21:56
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 955 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 49,336 KB
最終ジャッジ日時 2023-10-12 10:31:11
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,624 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N = int(input())
SA = [(a, i) for i, a in enumerate(map(int, input().split()), 1)]
SA.sort(reverse=True)
d_dist = deque([SA[0][0]])
d_id = deque([SA[0][1]])
for a, i in SA[1:]:
    if d_dist[0] >= d_dist[-1]:
        d_dist.appendleft(a)
        d_id.appendleft(i)
    else:
        d_dist.append(a)
        d_id.append(i)

ans = list(d_id)
ans.append(d_id[0])
print(*ans)
0