結果

問題 No.1537 私の代わりに仕事やっといてください。
ユーザー とりゐとりゐ
提出日時 2021-05-25 12:01:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 789 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 146,176 KB
最終ジャッジ日時 2023-08-17 18:36:36
合計ジャッジ時間 3,304 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,324 KB
testcase_01 AC 76 ms
71,000 KB
testcase_02 AC 789 ms
146,176 KB
testcase_03 AC 75 ms
71,324 KB
testcase_04 AC 75 ms
71,308 KB
testcase_05 AC 75 ms
71,168 KB
testcase_06 AC 77 ms
71,200 KB
testcase_07 AC 92 ms
76,632 KB
testcase_08 AC 92 ms
76,724 KB
testcase_09 AC 100 ms
76,608 KB
testcase_10 AC 129 ms
79,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=[[a[i],i] for i in range(n)]
b.sort(reverse=True)
x=[]
y=[]
for i in range(n):
  if i%2==0:
    x.append(b[i])
  else:
    y.append(b[i])
z=x+y[::-1]
for i in range(n):
  if z[i][1]==0:
    s=i
ans=[]
for i in range(s,n):
  ans.append(z[i][1]+1)
for i in range(s):
  ans.append(z[i][1]+1)
ans.append(1)
print(*ans)
0